Results 1 to 5 of 5
  1. #1
    hannehomuth's Avatar
    hannehomuth is offline Member
    Join Date
    Jul 2008
    Location
    Sommerfeld (Brandenburg, Germany)
    Posts
    36
    Rep Power
    0

    Default [SOLVED] App runs only in IDE

    Hello Everybody,

    I've a question which might be very simple but I didn't find anything. I've written an Java App and it runs well when I start it out of my IDE (Netbeans 6.1, if you wanna know). But when I want to start it from the command line I get an error which I can't resolve by myself. Here it is.

    Java Code:
    java -jar /home/jhomuth/projekte/LDAP/dist/LDAP.jar 
    Exception in thread "main" java.lang.NoClassDefFoundError: de.sourcepark.ldap.JNDI_GUI
       at java.lang.Class.initializeClass(libgcj.so.90)
    Caused by: java.lang.ClassNotFoundException: javax.swing.RowSorter not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/home/jhomuth/projekte/LDAP/dist/LDAP.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
       at java.net.URLClassLoader.findClass(libgcj.so.90)
       at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.90)
       at java.lang.ClassLoader.loadClass(libgcj.so.90)
       at java.lang.ClassLoader.loadClass(libgcj.so.90)
       at java.lang.Class.initializeClass(libgcj.so.90)
    I mean, I can think what is wrong, because I'am able to read, but what shall I do here? I've tried to Comment all Lines where the javax.swing.rowSorter is in, but then he throw the next Error, the same like that only with org.jdesktop.layout.GroupLayout. Does anyone has a Solution?

    Sorry about my bad english :-)
    Last edited by hannehomuth; 07-04-2008 at 06:49 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,899
    Rep Power
    25

    Default

    Do you know where the missing class file is? It needs to be on the classpath so that the java program can find it. If the missing class file is in a jar file, add a Class-Path: statement to the manifest that you use create your jar file and put the jar file with the missing class file in the same directory as your jar file.

    Are you using the same version of java in the IDE and outside it?

    This may be a Linux install problem. You'll get better advice on a Linux forum.
    Programming Talk - Ubuntu Forums
    Last edited by Norm; 07-04-2008 at 06:31 PM.

  3. #3
    hannehomuth's Avatar
    hannehomuth is offline Member
    Join Date
    Jul 2008
    Location
    Sommerfeld (Brandenburg, Germany)
    Posts
    36
    Rep Power
    0

    Default

    Yes I use the same Java Version, and I also think that this might be linux problems. I will try in the Forum you posted , thank you!!

  4. #4
    hannehomuth's Avatar
    hannehomuth is offline Member
    Join Date
    Jul 2008
    Location
    Sommerfeld (Brandenburg, Germany)
    Posts
    36
    Rep Power
    0

    Default

    I had to add all files to classpath, for anyone who wanna know

  5. #5
    glmarsh is offline Member
    Join Date
    Jul 2009
    Posts
    4
    Rep Power
    0

    Default

    Norm you mentioned whether the java versions were the same inside the IDE and Outside. I am having the same problem that hannehomuth is having but I haven't found a solution yet. I am running Eclipse in a Linux env. and my SWT application runs fine inside the IDE. When I run the application outside the IDE it blows up with unable to find org.eclipse.swt.widgets.Control class. I am pointing to Sun's JDK 1.6.0_14 locally from within the IDE but outside I am defaulting to the ICE version that comes with Fedora 11. When I run the program from the command line I use the following:
    "java -cp $Myclasspath -jar MyProgram.jar " Myclasspath is the list of jars that I had in my IDE Classpath for the Project and looks like this ".:j1.jar:j2.jar:j3.jar:swt.jar . I can see that the class is clearly in the swt.jar and package path is exactly what is not being found by the JVM classloader.

    Now the real rub is when I build the jar file in Ant it builds and compiles correctly but when I use the same classpath in the <java .... /> task to run the program I get the exact same error that I get on the command line.

    So what little nuance am I missing? Is this an issue with the JDK versions and if so how can I build using the same JDK in Ant but when running the compiled Jar from within Ant get the same errors I get when attempting to run from the command line?

    Sorry for the verboseness ....

Posting Permissions

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