aspose file tools*
The moose likes Beginning Java and the fly likes Jar file problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar file problem" Watch "Jar file problem" New topic
Author

Jar file problem

Jyothi Lature
Ranch Hand

Joined: Oct 31, 2001
Posts: 60
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

Jyothi<br />Sun Certified Java Programmer<br />Brainbench Certified for Javascript
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Have you set the Manifest file?

------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Jyothi Lature
Ranch Hand

Joined: Oct 31, 2001
Posts: 60
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
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
And what is your classpath, and where did you PUT the jar file?


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

Joined: Oct 31, 2001
Posts: 60

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"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
You need to put ab.jar into the classpath.
CLASSPATH=$APPPATH/ab.jar
Why is your API named in the classpath?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jar file problem