This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What about this error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What about this error message" Watch "What about this error message" New topic
Author

What about this error message

Awdhesh Kumar
Greenhorn

Joined: Mar 17, 2001
Posts: 3
Hello Friends
I have installed jdk1.3 beta. to test I worte this piece of code

<<file name is a1.java>>
import java.lang.*;
import java.util.* ;
import java.io.* ;
public class a1 {
public static void main(String args[] )
{
System.out.println("HI Awdhesh You have done it");
}
}
NO complie time error
while executing the error read is

" Exception in thread "main" java.lang.NoClassDefFoundError: a1 "
Can someone reply to this as what should I do
Also pl. specify what should be my classpath <<drive>>\jdk1.3 or ???

Thanks
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Your classpath needs to include whereever the class file for a1 is. Also make sure that the capitalization of your java command matches the way it is in the class file (looks right but . . .)


"JavaRanch, where the deer and the Certified play" - David O'Meara
Susan Delph
Ranch Hand

Joined: Feb 24, 2001
Posts: 34
Try running your program using this:

java -classpath . a1

The -classpath . specifies "look in THIS directory for a1".
Susan
Awdhesh Kumar
Greenhorn

Joined: Mar 17, 2001
Posts: 3
Thanks problem is solved.
Percy Densmore
Ranch Hand

Joined: Mar 06, 2001
Posts: 214
Thanks Susan,
I was having the same problem with my DOS Promt. Your tip worked for me too. Cool! Does that mean my Autoexec.bat is using a different classpath?
Percy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What about this error message
 
Similar Threads
Package Question II
Values of Hash Map to be 2-dimensional array
Whats happens actually.
compilation error
Read file from directory, update contents of the each file