Allan,
Newbie mistake #23: The argument to the Java launcher (the "java"
command) takes _class_ names, not class _file_ names as arguments.
By including the ".class" suffix you instructd the Java launcher to
invoke the "main" entry point in the class named "FirstLine.class"
while I'm sure the class you wrote is called simply "FirstLine".
Also, get the latest J2SDK, which is now 1.4.2. Bugs are routinely
fixed, performance improved and library API enhancements added.
Similar complaints ("java.lang.NoClassDefFoundError" can result from
class-path and package naming problems. Be sure you understand these
concepts and the java launcher options and environment variables that
pertain to locating class files.
Good luck.
Randall Schulz
Allan Robertson wrote:
Hello
I've downloaded the Java SDK 1.4.0 from Sun's website in the hope
to learning Java, however when I compile my *.java files this (at
most times) works fine, however when I run the *.class file using
java.exe I get this error message.
D:\jdk1.3\bin>java FirstLine.class
Exception in thread "main" java.lang.NoClassDefFoundError:
FirstLine/class
I'm using Windows XP Pro with Java Runtime 1.4.0. Can anyone help
me? Any help would be great.
Thanks