-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
[jvm-packages] NoClassDefError for javax/tools/ToolProvider #4000
Comments
What JVM are you using to compile it? It's at least Java 9, but is it 9, 10 or 11? |
Ah, I completely forgot... should've used a template. ('._.) Found a lot of issues online that suggested adding |
Adding
to the bottom of the scala-maven-plugin config fixed it for me on Linux. I don't have easy access to a configured Windows box to check it on that platform, but I suspect this will be sufficient. |
Apparently previously I had added this detail well nested under Seems like the build has started. I'll close this for now. |
Haha, doesn't seem to be leaving me (without of course using one of the pre-built JARs) 😛 -------------------------------------------------------
T E S T S
-------------------------------------------------------
Exception in thread "main" 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:566)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:513)
at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:525)
Caused by: java.lang.RuntimeException: Class java/util/UUID could not be instrumented.
at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:140)
at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:101)
at org.jacoco.agent.rt.internal_8ff85ea.PreMain.createRuntime(PreMain.java:55)
at org.jacoco.agent.rt.internal_8ff85ea.PreMain.premain(PreMain.java:47)
... 6 more
Caused by: java.lang.NoSuchFieldException: $jacocoAccess
at java.base/java.lang.Class.getField(Class.java:2000)
at org.jacoco.agent.rt.internal_8ff85ea.core.runtime.ModifiedSystemClassRuntime.createFor(ModifiedSystemClassRuntime.java:138)
... 9 more
FATAL ERROR in native method: processing of -javaagent failed
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for XGBoost JVM Package 0.82-SNAPSHOT:
[INFO]
[INFO] XGBoost JVM Package ................................ SUCCESS [ 15.672 s]
[INFO] xgboost4j .......................................... FAILURE [01:22 min]
[INFO] xgboost4j-spark .................................... SKIPPED
[INFO] xgboost4j-flink .................................... SKIPPED
[INFO] xgboost4j-example .................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:38 min
[INFO] Finished at: 2018-12-20T12:28:47+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project xgboost4j: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: The forked VM terminated without properly saying goodbye. VM crash or System.exit called?
[ERROR] Command was cmd.exe /X /C ""C:\Program Files\Java\jdk-11.0.1\bin\java" "-javaagent:C:\\Users\\shiva\\.m2\\repository\\org\\jacoco\\org.jacoco.agent\\0.7.9\\org.jacoco.agent-0.7.9-runtime.jar=destfile=C:\\Program Files\\xgboost\\jvm-packages\\xgboost4j\\target\\jacoco.exec" org.apache.maven.surefire.booter.ForkedBooter "C:\Program Files\xgboost\jvm-packages\xgboost4j\target\surefire\surefire13689783208094078316tmp" "C:\Program Files\xgboost\jvm-packages\xgboost4j\target\surefire\surefire_017480945474061054799tmp""
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :xgboost4j |
Bump the jacoco-maven-plugin version to 0.8.2. That has support for Java 11 class files. Then you get an error out of scalatest which I think requires bumping everything in the stack up beyond Java 9, and I'm not sure how to do that (see plasma-umass/doppio#497). I tried to bump the class file version to Java 9, but that caused a different error in ScalaTest (because it insists on picking up a Java 8 JDK from somewhere on my path - though you might not get this issue). I'd just skip the tests, it'll probably be fine. |
... But I did skip the tests 😱 |
I don't think we have gone so far to support anything beyond JDK8 |
System
Windows 10.0.17134
xgboost.dll
successfully compiled with MSVC Compiler.Log
Reproduce with
The default maybe_generator in
create_jni.py
(line 83 for me) has been changed to the required version,-G"Visual Studio 15 2017 Win64"
before proceeding with the maven install command. Successful completion before "Building Java Wrapper" has been omitted.The text was updated successfully, but these errors were encountered: