Spark only works with Java 8, 11 and 17 at the time writing this answer. Consider downgrading from Java 23 that you are using now to one of the versions specified.