• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

What about this error message

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 . . .)
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try running your program using this:

java -classpath . a1

The -classpath . specifies "look in THIS directory for a1".
Susan
 
Awdhesh Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks problem is solved.
 
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Dinner will be steamed monkey heads with a side of tiny ads.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic