I am fairly new to java and just can't get my java application which relies of external libraries working...
I have two libraries and an application, all exported from eclipse as jars. NOTE: I don't want them all exported into the same jar, as I wish to re-use the two libraries elsewhere.
- enix.lib.common.jar (library 1)
- enix.lib.events.jar (library 2)
- enix.cmd.events.jar (console application)
When I run:
java -jar enix.cmd.events.jar
I get:
Exception in thread "main" java.lang.NoClassDefFoundError: enix/lib/events/errors/EventLogNotAvailableException
Which obviously means it doesn't have the path to the enix.lib.events.jar (which if renamed to a zip file contains the file enix/lib/events/errors/EventLogNotAvailableException.class) - I then set the classpath in various ways like so:
java -cp ".;*.jar;enix.lib.events.jar" -jar enix.cmd.events.jar
But I get the same error. :( I also have a GUI app called enix.gnome.events.jar which relies on various jars in /usr/share/java and /opt/libs/jars.
Could someone please explain what I am getting wrong and why, I would be most grateful! THANKS!