scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

NumberFormatException: Not a version: 9 with Scala 2.11.12 #11735

Closed sandeepsingh6 closed 4 years ago

sandeepsingh6 commented 5 years ago

Hello, I discovered with a development pain that Scala 2.11.12 is throwing number format exception with following set of environment configurations.

Scala IDE with Eclipse: version 4.7
Eclipse Version: 2019-06 (4.12.0)
Spark Version: 2.4.4
Java Version: "1.8.0_221"

However the same set of configuration is working fine with Scala version 2.11.11 and Scala 2.11.8


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)
    at scala.tools.util.PathResolverBase$Calculated$.javaBootClasspath(PathResolver.scala:276)
    at scala.tools.util.PathResolverBase$Calculated$.basis(PathResolver.scala:283)
    at scala.tools.util.PathResolverBase$Calculated$.containers$lzycompute(PathResolver.scala:293)
    at scala.tools.util.PathResolverBase$Calculated$.containers(PathResolver.scala:293)
    at scala.tools.util.PathResolverBase.containers(PathResolver.scala:309)
    at scala.tools.util.PathResolver.computeResult(PathResolver.scala:341)
    at scala.tools.util.PathResolver.computeResult(PathResolver.scala:332)
    at scala.tools.util.PathResolverBase.result(PathResolver.scala:314)
    at scala.tools.nsc.backend.JavaPlatform$class.classPath(JavaPlatform.scala:28)
    at scala.tools.nsc.Global$GlobalPlatform.classPath(Global.scala:115)
    at scala.tools.nsc.Global.scala$tools$nsc$Global$$recursiveClassPath(Global.scala:131)
    at scala.tools.nsc.Global.classPath(Global.scala:128)
    at scala.tools.nsc.backend.jvm.BTypesFromSymbols.<init>(BTypesFromSymbols.scala:39)
    at scala.tools.nsc.backend.jvm.BCodeIdiomatic.<init>(BCodeIdiomatic.scala:24)
    at scala.tools.nsc.backend.jvm.BCodeHelpers.<init>(BCodeHelpers.scala:23)
    at scala.tools.nsc.backend.jvm.BCodeSkelBuilder.<init>(BCodeSkelBuilder.scala:25)
    at scala.tools.nsc.backend.jvm.BCodeBodyBuilder.<init>(BCodeBodyBuilder.scala:25)
    at scala.tools.nsc.backend.jvm.BCodeSyncAndTry.<init>(BCodeSyncAndTry.scala:21)
    at scala.tools.nsc.backend.jvm.GenBCode.<init>(GenBCode.scala:47)
    at scala.tools.nsc.Global$genBCode$.<init>(Global.scala:675)
    at scala.tools.nsc.Global.genBCode$lzycompute(Global.scala:671)
    at scala.tools.nsc.Global.genBCode(Global.scala:671)
    at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.serialVUID(GenASM.scala:1240)
    at scala.tools.nsc.backend.jvm.GenASM$JPlainBuilder.genClass(GenASM.scala:1329)
    at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.emitFor$1(GenASM.scala:198)
    at scala.tools.nsc.backend.jvm.GenASM$AsmPhase.run(GenASM.scala:204)
    at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1528)
    at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1513)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.wrapInPackageAndCompile(ToolBoxFactory.scala:197)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.compile(ToolBoxFactory.scala:252)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$$anonfun$compile$2.apply(ToolBoxFactory.scala:429)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$$anonfun$compile$2.apply(ToolBoxFactory.scala:422)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.liftedTree2$1(ToolBoxFactory.scala:355)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.apply(ToolBoxFactory.scala:355)
    at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.compile(ToolBoxFactory.scala:422)

For this development I have used code provided in deequ issue (https://github.com/awslabs/deequ/issues/116)

Looks like this is a Scala bug with Spark 2.4.4, since the same set of code is working fine with Scala version 2.11.11 and Scala 2.11.8

SethTisue commented 5 years ago

is the problem reproducible independently of Eclipse and independently of Spark? if so, how?

you report that you are using Java 8, but from the error message and stack trace, it appears to me you are actually using Java 9. is that possible? if so, can you downgrade to 8 or upgrade to 11? (9 and 10 were development versions)

eed3si9n commented 5 years ago

For reference:

eed3si9n commented 5 years ago

@sandeepsingh4 Could you come up with steps that we can reproduce this on our machine, without involving Scala IDE, like an sbt project we could run?

som-snytt commented 4 years ago

Verifying that scala.util.Properties belongs to 2.11.11:

https://github.com/scala/scala/blob/v2.11.11/src/library/scala/util/Properties.scala#L184

but the PathResolver belongs to 2.11.12:

https://github.com/scala/scala/blob/v2.11.12/src/compiler/scala/tools/util/PathResolver.scala#L276

These are in different jars, so no doubt the app is getting only the compiler jar for toolbox compilation, but the old library.

Kumar9676 commented 4 years ago

What is the resolution for this issue? I tried with both scala 2.11.11 and Scala 2.11.12. None seems working

SethTisue commented 4 years ago

@Kumar9676 are you using Eclipse? as far as we know so far, there isn't any Scala bug here. perhaps there is an Eclipse bug of some sort? nobody has presented clear evidence or reproduction steps, so we don't know.

som-snytt commented 4 years ago

Technically, the next decade begins on Jan 1, 2021, but 2019 feels like a whole decade ago.

I think 2020 should count as a lost decade, and calendar systems should be adjusted accordingly.

My previous comment makes it sound like a packaging or class path issue. I seem to remember there was ad hoc support for updating the Eclipse IDE? Maybe there is a wiki page describing what is supported and how to obtain it.

There is a link for commercial support! https://app.assembla.com/wiki/show/scala-ide/

Sample links to status on github, the last unmerged PR:

official release is up to [redacted] and he is now busy with other things.

https://github.com/scala-ide/scala-ide/pull/1189#issuecomment-401760192

To help others getting scala-ide working again

https://github.com/scala-ide/scala-ide/pull/1189#issuecomment-633437687

martijnhoekstra commented 4 years ago

Or phrased differently -- Scala IDE has no current maintainer, and unless you're going to maintain Scala IDE yourself, there is no reasonable expectation it'll get a new release ever again.