java.lang.NoClassDefFoundError with Java 9
See original GitHub issueWhen using JDK 9, the following happens:
Step 'removeUnusedImports' found problem in 'some-source.java':
javax/tools/JavaFileManager$Location
java.lang.NoClassDefFoundError: javax/tools/JavaFileManager$Location
at com.diffplug.spotless.java.GoogleJavaFormatStep$State.createRemoveUnusedImportsOnly(GoogleJavaFormatStep.java:113)
at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:76)
at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:76)
at com.diffplug.spotless.Formatter.compute(Formatter.java:230)
at com.diffplug.spotless.Formatter.isClean(Formatter.java:167)
at com.diffplug.gradle.spotless.SpotlessTask.check(SpotlessTask.java:216)
at com.diffplug.gradle.spotless.SpotlessTask.performAction(SpotlessTask.java:172)
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 org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:179)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:135)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:122)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
...
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to resolve java.lang.NoClassDefFoundError: javax/xml ...
Java 9 introduces the concepts of modules, and by default, the java.se aggregate module is available on the classpath (or rather, module-path).
Read more >Handling NoClassDefFoundError for JAXBException in Java 9
In this article, we'll look at a common missing class, JAXBException, and different ways we can solve it.
Read more >NoClassDefFoundError (Java SE 9 & JDK 9 )
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a...
Read more >[SOLVED-JAVA 9] java.lang.NoClassDefFoundError: javax ...
Java has made plan to remove the Java EE and CORBA modules from Java SE and the JDK after JDK 9 versions. In...
Read more >3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile...
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
Not a problem! Apologies from my side that I didn’t see an open issue for that! Thanks!
Apologies for not noticing earlier about this issue being a dupe!