Results 1 to 4 of 4
Thread: java runtime isn't running
- 03-24-2009, 04: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:
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
- 03-26-2009, 07: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, 04:34 AM #3
Member
- Join Date
- Feb 2009
- Posts
- 92
- Rep Power
- 0
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
- 03-31-2009, 07: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
Similar Threads
-
Help with Java Robot and Runtime Class
By Rmond1254 in forum New To JavaReplies: 1Last Post: 02-18-2009, 06:33 AM -
java.lang.NoClassDefFoundError in Eclipse at runtime
By debu37 in forum New To JavaReplies: 5Last Post: 09-03-2008, 05:29 PM -
Creating and using java objects at runtime...
By baran_khan in forum Advanced JavaReplies: 5Last Post: 08-28-2008, 05:36 PM -
running java
By Winarto in forum New To JavaReplies: 1Last Post: 08-22-2008, 06:40 AM -
Compiling and running code in runtime
By tim in forum New To JavaReplies: 4Last Post: 01-27-2008, 06:58 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks