Export JAR file



Hi,

w/ Eclipse 3.1, I wrote a small Java application making use of the JXTA
libraries (distributed as JAR files), then I exported my project as a
JAR file including my classes together w/ the JXTA libraries. When I
type "java -jar myapp.jar", I get the following message:

java.lang.NoClassDefFoundError:
net/jxta/discovery/DiscoveryListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Exception in thread "main"

Could someone explain me what I do wrong and how I can solve this
problem? Any help will be very much appreciated. Many thanks, Eric.

.



Relevant Pages

  • Re: Netbeans 5.5 & JWSDP 2 with .xml.bind import problems
    ... When I try to run the ant build script I get a message saying ... The same happens if I use Netbeans and create a new project based ... I'm generally a little confused about which jar files need to be ... around with the library manager in netbeans to add new libraries and ...
    (comp.lang.java.programmer)
  • Re: .jar classpath issues
    ... > third party jar files placed there would be accessible to your code, ... > to anyone else's code run using that JRE. ... code to have access to those libraries (I don't want to package the 3rd ...
    (comp.lang.java.help)
  • java.lang.NoClassDefFoundError
    ... I am developing a web application in JSF, usign application server 9.0 ... It works fine till I add 2 libraries, 2 .jar files in the project ... When I go in the log file of the server this is the error message I ... Anybody has an idea why when I add the two libraries at the project I ...
    (comp.lang.java.programmer)
  • Problem with JAR
    ... contain, respectively, images and sounds used in the application. ... works fine (obviously setting the classpath). ... - the two .jar files in libraries are not in the classpath causing the ...
    (comp.lang.java)