Ok, this seems to be a typical error as of discussing a lot in here, however I still don't know what's wrong with my program. I use commmand prompt to compile my java classes.
TestQueueString.java
is a simple class I create to test my implementation
of the block representation of queue in QueueStringBlock.java
. This is how I compile.
C:\Users\ME\Desktop\Lab>javac -cp DAT.jar;Exceptions.jar QueueStringBlock.java TestQueueString.java
C:\Users\ME\Desktop\Lab>javac TestQueueString
error: Class names, 'TestQueueString', are only accepted if annotation processing is
explicitly requested 1 error
Any help would be appreciated.
EDIT
And when I use java
instead of javac
, it always asks for main method I guess:
C:\Users\TRI\Desktop\Lab>java -cp DAT.jar;Exceptions.jar TestQueueString
Exception in thread "main" java.lang.NoClassDefFoundError: TestQueueString
Caused by: java.lang.ClassNotFoundException: TestQueueString
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: TestQueueString. Program will exit.
Be noticed that it does produce .class files after compiling :)