Results 1 to 4 of 4
  1. #1
    v1nsai's Avatar
    v1nsai is offline Member
    Join Date
    Mar 2009
    Posts
    28
    Rep Power
    0

    Default java runtime isn't running

    I've had java installed and running on my ubuntu box for a while now, and recently it has stopped running java programs. I can compile just fine, but not so much as a helloWorld will run, and I'm really confused about it. I have uninstalled and reinstalled every package I could find, and I still get the same error when I try to 'java nameOfProgram'. Here's the error output, I would really appreciate some help:
    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: numWin
    Caused by: java.lang.ClassNotFoundException: numWin
    	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    C:\DOS > C:\DOS.RUN > RUN.DOS.RUN

  2. #2
    v1nsai's Avatar
    v1nsai is offline Member
    Join Date
    Mar 2009
    Posts
    28
    Rep Power
    0

    Default

    sorry for the bump, I've been researching for days and have reinstalled and reinstalled my runtime, it was working fine before but has stopped for some reason and I can't figure out what it could be, any help appreciated this is making my java class a lot harder.
    C:\DOS > C:\DOS.RUN > RUN.DOS.RUN

  3. #3
    rdtindsm is offline Member
    Join Date
    Feb 2009
    Posts
    92
    Rep Power
    0

    Default classpath

    Don't claim to be a guru, but sounds suspiciously like the class path is not set.
    Don't know your background, so forgive me if I make this too explicit, and assume gaps in background.

    There is a hidden configuration file in your home directory called .bashrc, possibly .bash_profile. The former on my system. You will have to turn on the hidden file switch in the file browser, which can be done from the menu.

    The class path command is
    export CLASSPATH=/home/user/userclassdir:. or as needed.

    Note the "." at the end (or beginning of the classpath). Java is supposed to look in the current directory by default, but if CLASSPATH is set, you need the dot.

    A related problem is if you are using packages. If your path name is /workspace/project/src/package_name/source.java file your class path is
    /workspace/project/src/ Even if you are in the package_name dir, you need to run java package_name.source.
    Last edited by rdtindsm; 03-27-2009 at 04:38 AM. Reason: mispillins

  4. #4
    v1nsai's Avatar
    v1nsai is offline Member
    Join Date
    Mar 2009
    Posts
    28
    Rep Power
    0

    Default

    Thanks for the reply, I was playing with a classpath in an attempt to set up a cross compiler to compile java into objective c (language of iPhone) and it was a little above my head and I didn't reset my environment properly when I was done.

    I'm pretty sure that setting variables in .bashrc is temporary (which would have been smarter for me to use) but I set my classpath in /etc/environment and even after I had set it back I was still having problems. A simple restart put my changes into effect and I have learned something :)
    C:\DOS > C:\DOS.RUN > RUN.DOS.RUN

Similar Threads

  1. Help with Java Robot and Runtime Class
    By Rmond1254 in forum New To Java
    Replies: 1
    Last Post: 02-18-2009, 06:33 AM
  2. Replies: 5
    Last Post: 09-03-2008, 05:29 PM
  3. Creating and using java objects at runtime...
    By baran_khan in forum Advanced Java
    Replies: 5
    Last Post: 08-28-2008, 05:36 PM
  4. running java
    By Winarto in forum New To Java
    Replies: 1
    Last Post: 08-22-2008, 06:40 AM
  5. Compiling and running code in runtime
    By tim in forum New To Java
    Replies: 4
    Last Post: 01-27-2008, 06:58 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
  •