I am unable to run .jar
archives using Java 10 or Java 11 (they exit with NoClassDefFoundError
). Likewise, I am also unable to import .jar
archives into a Java Project; they appear in the Classpath, but Eclipse says that the import cannot be resolved. When I downgraded to Java 8, I was able to run .jar
archives just fine and they would also be recognized in any Java Project that imported them.
For example:
I am importing mongo-java-driver-3.8.2
into a Java Project on Eclipse Photon. I add the .jar
to the Project's Classpath (Project -> Properties -> Java Build Path). However, Eclipse outputs The import com.mongodb cannot be resolved
, as seen in the picture below: