• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NoClassDefFoundError

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have installed j2sdk1.4.1 and JBuilder which uses jdk1.3.1.
I make te hello world program an save it at my jdk141>
bin
Hello.java
why when i try to compile I got the error java.lang.NoClassDefFoundError
* the path is well set up cause when I execute java -version from any where I got:
java version 'jdk 1.4.1' ..........
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java.lang.NoClassDefFoundError

Usually you get this error when you try to run the program, not when you compile it. Are you compiling at the command line?
C:\>javac Hello.java
??

By the way, I suggest that you pick a different subdirectory to put your source files in. The bin subdirectory of the jdk should be kept only for the files that came with the jdk.
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From exactly what directory are you typing exactly what command and exactly where is the source file and what are your classpath and path settings (exactly)?
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, it's probably your JDK version.
I had the same problem until I changed the jdk version to 1.4
This is only my thought on what could be wrong, the previous posts have valid questions and responses.
good luck
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try one thing.....
modify your classpath to...:
c:\jdk141\lib\(jar file);%CLASSPATH%;.;
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic