Results 1 to 4 of 4
Thread: java runtime isn't running
- 03-24-2009, 05:13 AM #1
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:
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
- 03-26-2009, 08:46 PM #2
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
- 03-27-2009, 05:34 AM #3Member
- Join Date
- Feb 2009
- Rep Power
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 05:38 AM. Reason: mispillins
- 03-31-2009, 08:33 PM #4
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
- By Rmond1254 in forum New To JavaReplies: 1Last Post: 02-18-2009, 07:33 AM
- By debu37 in forum New To JavaReplies: 5Last Post: 09-03-2008, 06:29 PM
- By baran_khan in forum Advanced JavaReplies: 5Last Post: 08-28-2008, 06:36 PM
- By Winarto in forum New To JavaReplies: 1Last Post: 08-22-2008, 07:40 AM
- By tim in forum New To JavaReplies: 4Last Post: 01-27-2008, 07:58 PM