Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » java.lang.ClassNotFoundException with java9 and maven
java.lang.ClassNotFoundException with java9 and maven [message #1773944] Sat, 07 October 2017 00:41 Go to next message
Clement Guillaume is currently offline Clement GuillaumeFriend
Messages: 2
Registered: October 2017
Junior Member
I'm testing eclipse (oxygen 1a RC2 linux 64) and java 9 (oracle linux 64 release) and I'm encountering this issue. I have a maven project targeting java 8 with a simple pom.xml
<project omitting namespace declaration because this forum prevent me to include them>
	<modelVersion>4.0.0</modelVersion>
	<groupId>io.datarouter</groupId>
	<artifactId>j9mvn</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
	</properties>
</project>

with a simple class at src/main/java/j9mvn/Main.java
package j9mvn;
public class Main{
	public static void main(String[] args){
		System.out.println("Hello world");
	}
}

I imported the project in eclipse (File->Import...->Existing Maven Projects). When trying to run the main in eclipse I get:
Error: Could not find or load main class j9mvn.Main
Caused by: java.lang.ClassNotFoundException: j9mvn.Main


Eclipse project configuration looks ok: build path contains src/main/java as source folder and java 8 as library.
I see the class correctly generated at target/classes/j9mvn/Main.class

Any idea how to solve this issue?
Re: java.lang.ClassNotFoundException with java9 and maven [message #1774096 is a reply to message #1773944] Tue, 10 October 2017 13:56 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
This looks like https://bugs.eclipse.org/bugs/show_bug.cgi?id=525382 which has been fixed post RC2.
Re: java.lang.ClassNotFoundException with java9 and maven [message #1774122 is a reply to message #1774096] Tue, 10 October 2017 18:39 Go to previous messageGo to next message
Clement Guillaume is currently offline Clement GuillaumeFriend
Messages: 2
Registered: October 2017
Junior Member
Yes that was it. It's fixed in the latest build. Thanks.
Re: java.lang.ClassNotFoundException with java9 and maven [message #1774484 is a reply to message #1773944] Mon, 16 October 2017 08:58 Go to previous messageGo to next message
Eclipse UserFriend
This is uknown listener. Cannot find any jar containing that listener. If you know how to create jar using some zip utility or jar executable then you can copy the class com.tcs.weserv.util.Listener.class to the jar file preserving the folder structure which is important to find the corresponding class.
Re: java.lang.ClassNotFoundException with java9 and maven [message #1774497 is a reply to message #1774484] Mon, 16 October 2017 13:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
I find the content of this "answer" odd. Is this post in anyway related to the question or is it some strange form of spam?

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: java.lang.ClassNotFoundException with java9 and maven [message #1777212 is a reply to message #1774497] Mon, 27 November 2017 07:33 Go to previous messageGo to next message
Eclipse UserFriend
As nullpointer suggested, I updated to Maven 3.5.0, and it works now.
Re: java.lang.ClassNotFoundException with java9 and maven [message #1777217 is a reply to message #1777212] Mon, 27 November 2017 08:21 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
See the title of this original question? It says "ClassNotFoundException", so I'm not sure why you think that suggests a null pointer, nor why before you thought it was an unknown listener? You posts seem kind of random. It would be better if you did not make unfocused posts like this.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Eclipse good for Android Developement?
Next Topic:ant jdt batch compiler problem - no uniform encoding
Goto Forum:
  


Current Time: Thu Apr 25 08:25:28 GMT 2024

Powered by FUDForum. Page generated in 0.97933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top