• 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

Jar file problem

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a problem with jar file. When i start a java process using a jar file containing all the application class files, i get NoClassDefFoundError for a class even though that class file is present in the jar file.
FYI, this application is run in UNIX system.
Could anyone please help me asap.
Thanks in advance,
Jyothi
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you set the Manifest file?

------------------
Happy Coding,
Gregg Bolinger
 
Jyothi Lature
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply, Gregg.
Yep, i tried setting a manifest, still not working. Its not able to find the entry point class file. So, i tried mentioning it in the manifest file.
Here are the contents of my manifest file:
----------------------------------------------
Manifest-Version: 1.0
Main-Class: ab/Starter.class
MD5-Digest: (base64 representation of MD5 digest)
Name: ab/
Sealed: true
----------------------------------------
And to create the jar file iam using the following command:
jar -cvfm ab.jar abmanf *
-------------------------
Your help will be highly appreciated.
Thanks in advance,
Jyothi
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what is your classpath, and where did you PUT the jar file?
 
Jyothi Lature
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have set the classpath and jar file path in an executable .sh file. The contents of the .sh file are like this:
JAVA_HOME=/apps/Test/jre_1.2.2_09/bin
APPPATH=/apps/Test
CLASSPATH=$APPPATH/ab
CLASSPATH=$CLASSPATH:$APPPATH/ab/api/classes.zip
$JAVA_HOME/java -classpath
$CLASSPATH ab.AbStarter
Thanks in advance,
-Jyothi
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to put ab.jar into the classpath.
CLASSPATH=$APPPATH/ab.jar
Why is your API named in the classpath?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic