Results 1 to 3 of 3
  1. #1
    ecstatic is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default error while running jar file created from netbeans

    hi to all.I just joined this forum.

    I created jar file of my netbeans project and while running it using jar command from the command line , it gives the following error:
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
    at javaapplication2.stockmain$1.run(stockmain.java:17 )
    at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:226)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 602)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:275)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:200)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:185)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:177)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:138)
    Caused by: java.lang.ClassNotFoundException: org.jdesktop.layout.GroupLayout$Group
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 23)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 68)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:336)
    ... 9 more
    Can anyone plz help me find out the error or suggest any solution?

  2. #2
    ecstatic is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default

    The stockmain.java is already contained in the prboject folder. I can run my project in netbeans ide by running stockmain.java;

    So,it seems some problem i dont know what are there with the netbeans itself. So, i simply created new netbeans project and copied all my source files from old project to new and created jar and when i run it,
    lol, it run!

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Seems to me you have move the jar file, which is created in dist folder of the project folder, isn't it?

    In dist folder there is another folder call lib, which contain all library/packages you have used in your application. If you want to copy your jar file into some other place copy that lib folder too, and keep the same folder structure there.

    Before move to the jar file into another location, try to run it on the same location using command prompt as you tried earlier. It should work.

Similar Threads

  1. [SOLVED] Error while running eclipse
    By kimskams80 in forum Eclipse
    Replies: 3
    Last Post: 07-02-2008, 12:31 PM
  2. error while running jar file
    By ernieBob in forum NetBeans
    Replies: 1
    Last Post: 03-25-2008, 12:13 PM
  3. How to find file created date.....
    By roshithmca in forum Advanced Java
    Replies: 1
    Last Post: 02-18-2008, 10:48 AM
  4. NetBeans error
    By michcio in forum New To Java
    Replies: 1
    Last Post: 01-27-2008, 12:09 PM
  5. Replies: 7
    Last Post: 08-12-2007, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •