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

Creating a JAR file

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys;
I am a Java "Greenhorn", I am trying to create a JAR file for the first time and I am having some problems. I was successful in creating a package. I had to use the SET CLASSPATH so that my package could be found. I then tried the next step to create a JAR file. I compressed the directory structure and the .class files with no problem. I then moved the .JAR file into the jre/lib/ext directory. I can compile with no problem, it's when I run the application and try to instantiate a class from my JAR file that I get a "NoClassDefFoundError". The book I have said that you can take out any reference to the JAR file in your class path and that putting the JAR file in the jre/lib/ext directory will make it visible. My question is where or what am I doing wrong???
[ April 26, 2002: Message edited by: Ted Jaskot ]
Posts: 2205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do you have multiple versions of the JDK installed, If so, when you run "java" you may not be running the version you think you are, or the version where you've copied your jar.
First make sure your jar actually works by including it manually in the classpath. Then check the version of java you are running by typing
java -version
at the command prompt. Make sure it's the same version in which you copied your .jar file to the ext directory.
Also, please change your name to comply with the naming policy which you agreed to when you registered here..

For your publicly displayed name,
use a first name, a space, and a last name.

You can change your name here:

You can also find the naming policy here:
Thank You!
    Bookmark Topic Watch Topic
  • New Topic