lord bacon
June 25th, 2007, 01:45 AM
i seem to be having a problem with running java Programs from the command line, the programs (only very simple ones to see if this actually works) are compiling okay, but when i try to run them i am getting errors saying it cant find the main class, here is the output:
Exception in thread "main" java.lang.NoClassDefFoundError: Test.class
at gnu.java.lang.MainThread.run(libgcj.so.70)
Caused by: java.lang.ClassNotFoundException: Test.class not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.70)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj .so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at gnu.java.lang.MainThread.run(libgcj.so.70)
the code i was attempting to run was:
public class Test
{
public static void main (String[] args)
{
System.out.println("Test Program output");
}
}
as you can see it is very simple but i cant get it to run. this used to work using the usual java SDK, but when i installed eclipse it changed somethin somewhere, and now i cant run any programs, why is this happening.
thanks Lord Bacon
Exception in thread "main" java.lang.NoClassDefFoundError: Test.class
at gnu.java.lang.MainThread.run(libgcj.so.70)
Caused by: java.lang.ClassNotFoundException: Test.class not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.70)
at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj .so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at java.lang.ClassLoader.loadClass(libgcj.so.70)
at gnu.java.lang.MainThread.run(libgcj.so.70)
the code i was attempting to run was:
public class Test
{
public static void main (String[] args)
{
System.out.println("Test Program output");
}
}
as you can see it is very simple but i cant get it to run. this used to work using the usual java SDK, but when i installed eclipse it changed somethin somewhere, and now i cant run any programs, why is this happening.
thanks Lord Bacon