Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala 2.10 with JDK9 compilation error #10871

Closed
vveider opened this issue May 10, 2018 · 5 comments
Closed

Scala 2.10 with JDK9 compilation error #10871

vveider opened this issue May 10, 2018 · 5 comments

Comments

@vveider
Copy link

vveider commented May 10, 2018

Hi, Scala dev team!

I'm trying to compile Apache Ignite #master under JDK9 and one of it's modules (ignite-scalar_2.10) is categorically refuses to do so.

I run
mvn install -U -Pall-java,all-scala,licenses,lgpl,examples -DskipTests -Dmaven.javadoc.skip=true -pl :ignite-scalar_2.10 -am

and have the following problems:

[INFO] 	at scala.reflect.io.JavaToolsPlatformArchive.iterator(ZipArchive.scala:242)
[INFO] 	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
[INFO] 	at scala.reflect.io.AbstractFile.foreach(AbstractFile.scala:92)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.traverse(ClassPath.scala:308)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.x$16$lzycompute(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.x$16(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.packages$lzycompute(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:297)
[INFO] 	at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:375)
[INFO] 	at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:375)
[INFO] 	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
[INFO] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
[INFO] 	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
[INFO] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
[INFO] 	at scala.tools.nsc.util.MergedClassPath.packages$lzycompute(ClassPath.scala:375)
[INFO] 	at scala.tools.nsc.util.MergedClassPath.packages(ClassPath.scala:370)
[INFO] 	at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:243)
[INFO] 	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:194)
[INFO] 	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
[INFO] 	at scala.reflect.internal.Mirrors$RootsBase.init(Mirrors.scala:240)
[INFO] 	at scala.tools.nsc.Global.rootMirror$lzycompute(Global.scala:59)
[INFO] 	at scala.tools.nsc.Global.rootMirror(Global.scala:57)
[INFO] 	at scala.tools.nsc.Global.rootMirror(Global.scala:37)
[INFO] 	at scala.reflect.internal.Definitions$DefinitionsClass.<init>(Definitions.scala:166)
[INFO] 	at scala.reflect.internal.Definitions$definitions$.<init>(Definitions.scala:20)
[INFO] 	at scala.reflect.internal.SymbolTable.definitions$lzycompute(SymbolTable.scala:13)
[INFO] 	at scala.reflect.internal.SymbolTable.definitions(SymbolTable.scala:13)
[INFO] 	at scala.tools.nsc.Global$Run.<init>(Global.scala:1290)
[INFO] 	at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
[INFO] 	at scala.tools.nsc.Main$.doCompile(Main.scala:79)
[INFO] 	at scala.tools.nsc.Driver.process(Driver.scala:54)
[INFO] 	at scala.tools.nsc.Driver.main(Driver.scala:67)
[INFO] 	at scala.tools.nsc.Main.main(Main.scala)
[INFO] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[INFO] 	at scala_maven_executions.MainHelper.runMain(MainHelper.java:164)
[INFO] 	at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[INFO]
[INFO] java.lang.reflect.InvocationTargetException
[INFO] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[INFO] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[INFO] 	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
[INFO] 	at scala_maven_executions.MainHelper.runMain(MainHelper.java:164)
[INFO] 	at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
[ERROR] Caused by: java.lang.NoClassDefFoundError: javax/tools/ToolProvider
[INFO] 	at scala.reflect.io.JavaToolsPlatformArchive.iterator(ZipArchive.scala:242)
[INFO] 	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
[INFO] 	at scala.reflect.io.AbstractFile.foreach(AbstractFile.scala:92)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.traverse(ClassPath.scala:308)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.x$16$lzycompute(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.x$16(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.packages$lzycompute(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:317)
[INFO] 	at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:297)
[INFO] 	at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:375)
[INFO] 	at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:375)
[INFO] 	at scala.collection.Iterator$class.foreach(Iterator.scala:727)
[INFO] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
[INFO] 	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
[INFO] 	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
[INFO] 	at scala.tools.nsc.util.MergedClassPath.packages$lzycompute(ClassPath.scala:375)
[INFO] 	at scala.tools.nsc.util.MergedClassPath.packages(ClassPath.scala:370)
[INFO] 	at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader.doComplete(SymbolLoaders.scala:243)
[INFO] 	at scala.tools.nsc.symtab.SymbolLoaders$SymbolLoader.complete(SymbolLoaders.scala:194)
[INFO] 	at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
[INFO] 	at scala.reflect.internal.Mirrors$RootsBase.init(Mirrors.scala:240)
[INFO] 	at scala.tools.nsc.Global.rootMirror$lzycompute(Global.scala:59)
[INFO] 	at scala.tools.nsc.Global.rootMirror(Global.scala:57)
[INFO] 	at scala.tools.nsc.Global.rootMirror(Global.scala:37)
[INFO] 	at scala.reflect.internal.Definitions$DefinitionsClass.<init>(Definitions.scala:166)
[INFO] 	at scala.reflect.internal.Definitions$definitions$.<init>(Definitions.scala:20)
[INFO] 	at scala.reflect.internal.SymbolTable.definitions$lzycompute(SymbolTable.scala:13)
[INFO] 	at scala.reflect.internal.SymbolTable.definitions(SymbolTable.scala:13)
[INFO] 	at scala.tools.nsc.Global$Run.<init>(Global.scala:1290)
[INFO] 	at scala.tools.nsc.Driver.doCompile(Driver.scala:32)
[INFO] 	at scala.tools.nsc.Main$.doCompile(Main.scala:79)
[INFO] 	at scala.tools.nsc.Driver.process(Driver.scala:54)
[INFO] 	at scala.tools.nsc.Driver.main(Driver.scala:67)
[INFO] 	at scala.tools.nsc.Main.main(Main.scala)
[INFO] 	... 6 more```

Scala version is 2.10.7

Can you please advise some workaround or alike?


Thanks!
@SethTisue
Copy link
Member

looks like a duplicate of #10603, if I'm wrong lmk

@SethTisue
Copy link
Member

SethTisue commented May 11, 2018

note that in general Scala 2.10 is only just baaaarely supported on JDK 9+, and even that minimal support primarily exists for users who are still upgrading from sbt 0.13 (which needs 2.10) to sbt 1. so just be aware that this may not be the only problem you hit.

most Scala library authors are no longer publishing new versions for 2.10.

@vveider
Copy link
Author

vveider commented May 14, 2018

@SethTisue, if it is duplicate, then can you advise how should I set scala compiler options from maven?

@martin-g
Copy link

@vveider Does this example help you ?

@vveider
Copy link
Author

vveider commented May 14, 2018

@martin-g, thanks, that worked!
@SethTisue, FYI, -nc is unrecognized option, though -nobootcp is enough for successful compilation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants