question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

doc-jar fails on OpenJDK 9+

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:12

github_iconTop GitHub Comments

1reaction
asmotrichcommented, Dec 17, 2019

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:

you say it doesn’t work for you in your project. perhaps you are doing something differently?

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…).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/davidB/scala-maven-plugin/issues/376?email_source=notifications&email_token=AFMMEQBFEQX5LQZF6OBCCNLQZDVBJA5CNFSM4JY5T3ZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHCXEPQ#issuecomment-566587966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMMEQBATZPXLHGN4MU3MZDQZDVBJANCNFSM4JY5T3ZA .

0reactions
slandellecommented, Dec 17, 2019

you say it doesn’t work for you in your project. perhaps you are doing something differently?

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…).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found