doc-jar fails on OpenJDK 9+
See original GitHub issueThe error is:
[INFO] --- scala-maven-plugin:4.3.0:doc-jar (scala-doc-jar) @ csv-validator-core ---
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at scala_maven_executions.MainHelper.runMain(MainHelper.java:161)
at scala_maven_executions.MainWithArgsInFile.main(MainWithArgsInFile.java:26)
Caused by: java.lang.NoClassDefFoundError: javax/tools/ToolProvider
at scala.reflect.io.JavaToolsPlatformArchive.iterator(ZipArchive.scala:301)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.reflect.io.AbstractFile.foreach(AbstractFile.scala:92)
at scala.tools.nsc.util.DirectoryClassPath.traverse(ClassPath.scala:277)
at scala.tools.nsc.util.DirectoryClassPath.x$15$lzycompute(ClassPath.scala:299)
at scala.tools.nsc.util.DirectoryClassPath.x$15(ClassPath.scala:299)
at scala.tools.nsc.util.DirectoryClassPath.packages$lzycompute(ClassPath.scala:299)
at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:299)
at scala.tools.nsc.util.DirectoryClassPath.packages(ClassPath.scala:264)
at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:358)
at scala.tools.nsc.util.MergedClassPath$$anonfun$packages$1.apply(ClassPath.scala:358)
at scala.collection.Iterator$class.foreach(Iterator.scala:891)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1334)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at scala.tools.nsc.util.MergedClassPath.packages$lzycompute(ClassPath.scala:358)
at scala.tools.nsc.util.MergedClassPath.packages(ClassPath.scala:353)
at scala.tools.nsc.symtab.SymbolLoaders$PackageLoader$$anonfun$doComplete$1.apply$mcV$sp(SymbolLoaders.scala:269)
Adding the option-nobootcp
to the args for doc-jar
seems to be a viable workaround, i.e.:
<execution>
<id>scala-doc-jar</id>
<phase>package</phase>
<goals>
<goal>doc-jar</goal>
</goals>
<configuration>
<args>
<arg>-nobootcp</arg>
</args>
</configuration>
</execution>
Issue Analytics
- State:
- Created 4 years ago
- Comments:12
Top Results From Across the Web
OpenJDK 9 SSL error with gradlew - java - Stack Overflow
I recently upgraded to OpenJDK 9 but am now encountering errors with CI build. Exception in thread "main" javax.net.ssl.
Read more >Can not install 'openjdk-9-jdk' because it tries to overwrite file ...
I was able to solve the error myself by forcing the file override when installing the .deb package with dpkg . Here's my...
Read more >Error (Java SE 9 & JDK 9 ) - Oracle Help Center
An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch. Most such errors...
Read more >JDK 9 installation fails with error message "Another Java ...
Any early release build of JDK 9 (such as the current b177) ADDITIONAL OS VERSION INFORMATION : Microsoft Windows [Version 10.0.15063] (64-bit)
Read more >Release Notes - Open source, prebuilt OpenJDK binaries
For jdk11_0_11+9 fixes see CVE and JDK bug fixes at bugs.openjdk.java.net. ... key fails with ClassCastException for SunPKCS11 provider; JDK-8204152: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Exactly the same in my case: I put configuration at the execution level and it did not work, once I followed recommendations in SethTisue@217d282 https://github.com/SethTisue/scala-maven-plugin/commit/217d28273ec309ccfc32341e076c6e8f44291c3e and put it at the root level everything worked correctly. This is perfectly functional workaround, end of story IMHO.
I figured a way to move my environment forward to Scala 2.12 and everything seems to be in good order.
Thanks!
On Tue, Dec 17, 2019 at 7:21 AM Stephane Landelle notifications@github.com wrote:
On my side, it didn’t work but I configured at execution level instead of root one, which might have been wrong (I never remember how this works…).