Problem with java
I compiled a simple program with javac then when I tried to run it I got this error.
[Colin@localhost JavaSource]$ javac PCFixed.java
[Colin@localhost JavaSource]$ java PCFixed.class
Exception in thread "main" java.lang.NoClassDefFoundError: PCFixed/class
Caused by: java.lang.ClassNotFoundException: PCFixed.class
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: PCFixed.class. Program will exit.
[Colin@localhost JavaSource]$
I also tried another program I knew worked yesterday and it gave the same error. I was wondering if anybody knew what was wrong with this thing. When I use Netbeans everything goes ok but I don't like using it at the moment as these are all simple little programs that don't require the package statement and netbeans seems to think that everything needs to be in a package. I prefer freestyle anyway. Any help would be great.
|