I've just upgraded from 2.10M4 to 2.10M6 and my ant config which has worked since 2.9 has stopped working. The error I'm getting is:
/home/alanbur/scala/OLS/build.xml:13: The following error occurred while executing this line:
/home/alanbur/scala/OLS/build-scala.xml:14: The following error occurred while executing this line:
jar:file:/opt/scala/lib/scala-compiler.jar!/scala/tools/ant/antlib.xml:5: taskdef A class needed by class scala.tools.ant.FastScalac cannot be found: scala/reflect/internal/settings/MutableSettings$SettingValue using the classloader AntClassLoader[/opt/scala/lib/scala-library.jar:/opt/scala/lib/scala-compil er.jar]
but I also needed to add scala-library to fix a problem with running the tests. In general, when upgrading to -M5 or -M6, take a look at $SCALA_HOME/lib/, since libraries have been split much more granularly. Actors have also been split out from the main library for various reasons (the Akka actor library is being integrated as an alternative, in some way).
Il giorno sabato 4 agosto 2012 01:13:58 UTC+2, Alan Burlison ha scritto:
> I've just upgraded from 2.10M4 to 2.10M6 and my ant config which has > worked since 2.9 has stopped working. The error I'm getting is:
> /home/alanbur/scala/OLS/build.xml:13: The following error occurred while > executing this line: > /home/alanbur/scala/OLS/build-scala.xml:14: The following error occurred > while executing this line: > jar:file:/opt/scala/lib/scala-compiler.jar!/scala/tools/ant/antlib.xml:5: > taskdef > A class needed by class scala.tools.ant.FastScalac cannot be found: > scala/reflect/internal/settings/MutableSettings$SettingValue using the > classloader > AntClassLoader[/opt/scala/lib/scala-library.jar:/opt/scala/lib/scala-compil er.jar]
> That was the hint I needed, thanks. I've modified my ant file to add in
> references to scala-reflect.jar as follows, and that's fixed the problem:
I spoke too soon. It apparently works with the ant fsc task, but the scalac task blows up:
uncaught exception during compilation: scala.reflect.internal.FatalError
scala.reflect.internal.FatalError: package reflect does not have a member ClassManifest
at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$ Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:979)
at scala.reflect.internal.Definitions$DefinitionsClass$$anonfun$getMember$1.ap ply(Definitions.scala:1008)
at scala.reflect.internal.Definitions$DefinitionsClass$$anonfun$getMember$1.ap ply(Definitions.scala:1003)
at scala.reflect.internal.Symbols$Symbol.orElse(Symbols.scala:2332)
at scala.reflect.internal.Definitions$DefinitionsClass.getMember(Definitions.s cala:1002)
at scala.reflect.internal.Definitions$DefinitionsClass.getMemberType(Definitio ns.scala:1027)
at scala.reflect.internal.Definitions$DefinitionsClass.PartialManifestClass$lz ycompute(Definitions.scala:467)
at scala.reflect.internal.Definitions$DefinitionsClass.PartialManifestClass(De finitions.scala:467)
at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.<init>(Implicits.scala :1221)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:8 2)
at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:488)
at scala.tools.nsc.typechecker.Implicits$class.inferImplicit(Implicits.scala:3 7)
at scala.tools.nsc.Global$$anon$1.inferImplicit(Global.scala:488)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$2.apply (Typers.scala:133)
at scala.tools.nsc.typechecker.Typers$Typer$$anonfun$applyImplicitArgs$2.apply (Typers.scala:128)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala: 59)
at scala.collection.immutable.List.foreach(List.scala:78)
[rest of stack trace snipped]
The same code compiles fine with scalac from the command-line. Any suggestions of how to track this down?
could you post the solution please. I could not really understand "The fix is to delete and recreate the Scala NetBeans libraries and the project references to them and make sure that the versions of the libraries that end up in $PROJECT/lib correspond to the scalac version you are using."
I can't even remove the scala platform from Netbeans.
> could you post the solution please. I could not really understand "The fix
> is to delete and recreate the Scala NetBeans libraries and the project
> references to them and make sure that the versions of the libraries that
> end up in $PROJECT/lib correspond to the scalac version you are using."
NetBeans usually keeps a local copy of scala-library.jar inside your project. If you update the scala version, it doesn't get updated so you get all sorts of oddness because of the mismatch - and because scala is self-hosted, that includes compile-time oddness, not just run-time oddness. That's why you need to manually clean up any old copies that are lying around and make sure everything matches version-wise.