-->

Exception in thread “main” java.lang.NumberFormatE

2019-04-14 14:55发布

问题:

I am trying to run a Spark maven Scala Project in eclipse .

when i run the scala class , i get this error :

Exception in thread "main" java.lang.NumberFormatException: Not a version: 9
at scala.util.PropertiesTrait$class.parts$1(Properties.scala:184)
at scala.util.PropertiesTrait$class.isJavaAtLeast(Properties.scala:187)
at scala.util.Properties$.isJavaAtLeast(Properties.scala:17)
....

what is wrong ? what is a version 9 ?

回答1:

Scala does not work with Java 9 out of the box just yet - there is a way, but you have to be sure that various components in your mix have minimal versions required for compatibility.

See this compatibility matrix (notice Java, Scala and SBT versions)

and this issue for more details.

The easiest fix is to run your Spark project in Eclipse using Java 8.