I'm having trouble running java programs on my ubuntu box. I was coding something for my java class, and became suspicious when my programs kept returning this when I ran 'java nameOfProgram':
I get the same error when I run examples from the book. They all have main methods, which is what the error seems to be complaining about. Everything runs fine on Windows XP in virtualbox.Code:Caused by: java.lang.ClassNotFoundException: TempTest at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336) Could not find the main class: TempTest. Program will exit.
So, first of all what the hell? Why did this happen? I've been running java on my computer no problem for a while now. And second, what can I do to fix this? I've already tried 'sudo apt-get remove sun-java6-jre sun-java6-jdk' and 'sudo apt-get install sun-java6-jre sun-java6-jdk' but still the same problems. I can compile with no hitch, it just seems to be the runtime. Help appreciated, I'm stumped.
Bookmarks