Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » ClassNotFoundException with runnable jar
ClassNotFoundException with runnable jar [message #1850003] Thu, 10 February 2022 16:53 Go to next message
csaffi Mising name is currently offline csaffi Mising nameFriend
Messages: 2
Registered: July 2009
Junior Member
I made a runnable jar with packed libraries.

I'm going mad with java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

even if I added MySql Connector J in my Java Build Path.

This exception is thrown on a machine with openjdk 11.0.8, while it's not thrown on machines with 1.8.0_302.

When I try to export the runnable jar with libraries inside the lib subfolder, the exception becomes:
java.lang.NoClassDefFoundError: javax/activation/DataSource

Is it not possible to export a runnable JAR from a dev machine with Java 8 and running it on Java 11 ??
Re: ClassNotFoundException with runnable jar [message #1850104 is a reply to message #1850003] Wed, 16 February 2022 06:06 Go to previous messageGo to next message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
You said you made a runnable Jar. But didn't specify how you are running. Are you running it from Eclipse or from command line? In either case, can you share what the command looks like?

[Updated on: Wed, 16 February 2022 06:07]

Report message to a moderator

Re: ClassNotFoundException with runnable jar [message #1850108 is a reply to message #1850104] Wed, 16 February 2022 08:05 Go to previous message
csaffi Mising name is currently offline csaffi Mising nameFriend
Messages: 2
Registered: July 2009
Junior Member
I solved the problem downgrading OpenJDK from 11 to 8 on the server were the JAR is running.

Regarding your questions:
- I'm running it from command line
- The command looks like "java -jar myapp.jar"
Previous Topic:generalize Eclipse Linux/GTK3 support to Unix/GTK3
Next Topic:WYSIWYG javascript visual designer and layout tools
Goto Forum:
  


Current Time: Sat Apr 20 00:16:39 GMT 2024

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

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

Back to the top