4

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 ?

A.HADDAD
  • 1,809
  • 4
  • 26
  • 51
  • what scala version are you using? – diginoise Jul 18 '18 at 09:36
  • 1
    the scala version is : **4.7.1** – A.HADDAD Jul 18 '18 at 09:45
  • that's your Scala IDE version. Check in the settings which JDK it is using. – diginoise Jul 18 '18 at 09:50
  • where can i find it's settings in eclipse ? i find under Scala Library Container folder in Manifest.mf this :Bundle-RequiredExecutionEnvironment: JavaSE-1.6, JavaSE-1.7 – A.HADDAD Jul 18 '18 at 10:04
  • what does your `java -version` typed in the console returns? What is JAVA_HOME and/or PATH set to with regards to Java? I had not used ScalaIDE... in Eclipse it's **Eclipse Preferences -> Java -> Installed JREs** – diginoise Jul 18 '18 at 10:26
  • java -version returns **java version "1.8.0_171"**. JAVA_HOME is : C:\Program Files\Java\jdk1.8.0_151 In eclipse preferences I have a list of jre in **INSTALLED JRE** including jre 1.6 ,1.7 ,1.8 ,9 and others – A.HADDAD Jul 18 '18 at 10:44
  • you can follow [the steps done by the owner of the project before my last comment](https://github.com/opencypher/caps-examples/issues/2) to execute it. it works for him with eclipse. – A.HADDAD Jul 18 '18 at 12:53
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/176258/discussion-between-a-haddad-and-diginoise). – A.HADDAD Jul 18 '18 at 14:26

1 Answers1

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.

diginoise
  • 7,352
  • 2
  • 31
  • 39