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.

java.lang.NoClassDefFoundError with Java 9

See original GitHub issue

When 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
boris-petrovcommented, Sep 25, 2017

Not a problem! Apologies from my side that I didn’t see an open issue for that! Thanks!

0reactions
jbduncancommented, Sep 25, 2017

Apologies for not noticing earlier about this issue being a dupe!

Read more comments on GitHub >

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

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