Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar file problem

 
Jyothi Lature
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • 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
  • 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"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic