[thelist] Java: basic help?

Joel Stevenson joelstevenson at mac.com
Fri Sep 20 12:05:01 CDT 2002


>
>Copy and Paste
>--
>C:\JavaProjects>java HelloWorld
>Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
>--
>
>Does this look like to need to un-install and re-install all
>over again? (Getting tired of not being able to get it to
>work).
>

Frank,

It sounds like the current working directory is not on in the
CLASSPATH.  The JVM only looks for class files on explicitly defined
system paths.  This can be done with either an environment variable
(CLASSPATH) or by executing the JVM with the -classpath option; in
your case try:

java -classpath C:\javaprograms HelloWorld

see http://java.sun.com/j2se/1.4/docs/tooldocs/windows/classpath.html
for more details

-Joel




More information about the thelist mailing list