Started with Java Programming....  

Posted by shashank in


Monday, May 25, 2009
Today (actually Yesterday considering it is 0236hrs in the morning) I started with Java programming. Downloaded the ebooks Complete Reference Java by Herbert Schildt and Java for dummies from esnips.com
Also downloaded the bundle of JDK and Netbeans from Sun's official site.

After fiddling with netbeans for some time I ventured into the command prompt method of operating Java. After a lot of headache and changing variables in Control Panel>System>Advanced>System Variable I was able to correctly execute "javac HelloWorldApp.java" command, which worked fine.
But I could not execute "java HelloWorldApp" command which kept on returning the error:
Exception in thread "main" java.lang.noclassdef
..
..

So to see whether this was a universal problem I tried downloading the CMUcamGUI files which were bundled with the CMUCAM I used for my robot Ouimet.
Even that thing did not execute for a while when I tried "java CMUcamGUI" (the class file was already there; so no need of javac command).
Finally I tried the command "java -classpath . CMUcamGUI" which asks the compiler to look for the class file in the current directory. That solved the problem for CMUcamGUI but the problem for HelloWorldApp still persists.

Moral of the story: Remember the following command (though it has not entirely solved the above problem)
java -classpath . CMUcamGUI





This entry was posted on Sunday, May 24, 2009 at 11:35 PM and is filed under . You can follow any responses to this entry through the comments feed .

0 comments

Post a Comment