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
JavaRanch » Java Forums » Java » Java in General
Bookmark "Getting JDK 1.3 to work!" Watch "Getting JDK 1.3 to work!" New topic
Author

Getting JDK 1.3 to work!

mimi goh
Greenhorn

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 HelloWorld.java 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:
SET CLASSPATH=%CLASSPATH%;.;
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.
------------------
Shubhrajit


Shubhrajit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting JDK 1.3 to work!