Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Classpath being ignored?(Java classpath via Eclipse IDE seems to be ignored)
Classpath being ignored? [message #1854734] Mon, 05 September 2022 22:04 Go to next message
Will L is currently offline Will LFriend
Messages: 1
Registered: September 2022
Junior Member
Fresh install of Eclipse for Java Developers, 2022-06-R

Trying to run the following code:
import com.adobe.internal.xmp.XMPException;

public class JpegScanner {

	public static void main(String[] args) throws Exception {
		new XMPException("foo", 123).printStackTrace();
	}
}

I placed the xmpcore-6.1.11.jar file from Adobe in the base directory of the project and used Project -> Properties->Java Build Path->Libraries->Modulepath->Add Jars... to add the jar file to the class path for the project/IDE.
The IDE shows no error markers or build problems. But when I try to run the application from inside the Eclipse IDE I get the following:
Exception in thread "main" java.lang.NoClassDefFoundError: com/adobe/internal/xmp/XMPException
	at meta.exif.JpegScanner.main(JpegScanner.java:8)
Caused by: java.lang.ClassNotFoundException: com.adobe.internal.xmp.XMPException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 1 more

I have confirmed that the jar file does in fact have the /com/adobe/internal/xmp/XMPException.class file inside of it.
What's even weirder is that if I export the project as a Runnable JAR file and tell it to extract required libraries into the generated jar, I can run that executable jar from the command line and it works just fine...
I'm on Ubuntu 22.04.1 LTS if it makes any difference.
Re: Classpath being ignored? [message #1855062 is a reply to message #1854734] Tue, 27 September 2022 05:09 Go to previous message
Jay Arthanareeswaran is currently offline Jay ArthanareeswaranFriend
Messages: 128
Registered: July 2009
Senior Member
Looks like the jar is not added to the classpath. To confirm or rule it out, can you please share what the command line looks like? You can get it by going to the Java Application's Run configuration and select the "Show Command Line" option.
Previous Topic:Eclipse IDE for Java Developers fails to update
Next Topic:After installing eclipse-java-2022-09 I cannot create Maven project using archetype
Goto Forum:
  


Current Time: Fri Apr 26 08:24:06 GMT 2024

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

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

Back to the top