aspose file tools
The moose likes Java in General and the fly likes Getting JDK 1.3 to work! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Getting JDK 1.3 to work!" Watch "Getting JDK 1.3 to work!" New topic

Getting JDK 1.3 to work!

mimi goh

Joined: Dec 10, 2001
Posts: 3
I have windows 98 2nd edition, and have installed and set the path for jdk 1.3..i compiled a simple file OK, but can't run the HelloWorld.class file!
What am I doing wrong? I got this error message:
C:\J21Work>java HelloWorld
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
You get that error when the JVM tries to load a class and it can't find it. Try specifying the classpath when you run it:
java -cp c:\path\to\your\class\file YourClass
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Or more specifically in your case:
java -cp C:\J21Work HelloWorld
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
That's weird. Shouldn't the current directory be included in the classpath always? I've never had any problems with that. You could do this instead of using -cp:
java SomeClass
Shubhrajit Chatterjee
Ranch Hand

Joined: Aug 23, 2001
Posts: 356
Configure the current directory(.) as a part of the classpath in your autoexec.bat file so that you don't face problems again later.

I agree. Here's the link:
subject: Getting JDK 1.3 to work!
jQuery in Action, 3rd edition