This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with java.lang.NoClassDefFound error  RSS feed

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm working on a service to prepare spreadsheet for a report. I'm using jxl-2.4.2.jar to achieve this ( please note that I can't use the latest version due to compatability constraints). When I execute the code locally on my eclipse it works fine. My eclipse has java 1.5.
When I deploy my code in my test environment, its giving NoClassdefFound error for jxl.* ( any classes in jxl ). My test environment has IBMs java 1.5. I believe it doesn't make any differece if I use IBMs version or Sun's version of java in this context.
I believe this error could happen when JVM fails to load the class at runtime or if the class has any static methods/properties. I checked the classes and none of them have static contents. So, this could be something else.
FYI.. I'm using ant to build the project & I check the build.xml. It is showing the correct version of java 1.5. Could some one please help to fix this error? Also Just FYI.. my project resides on AIX 5.0 server.
Any help in this regard much apprecitated. Thanks in advance.
 
Bartender
Posts: 3307
86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like your test environment doesn't have jxl-2.4.2.jar on it's classpath and so can't find any of the JXL classes your code references.
 
santosh batta
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tony,
Thanks for your reply. The jar file was mentioned in the build.xml file.
<property name="ModuleClasspath" value="
${JAVA_HOME}/jre/lib/core.jar;
${JAVA_HOME}/jre/lib/server.jar;
${thirdparty}/ConnectDirect/CDJAI.jar;
${thirdparty}/mail/activation.jar;
${thirdparty}/mail/mail.jar;
${thirdparty}/jxl-2.4.2.jar;
${thirdparty}/Snow/Snow.jar;
${thirdparty}/scheduler-client.jar;
${thirdparty}/icu.jar;"/>
We are using java 1.5 for build & depolying this jar on test environment that has java 1.4.2. Does it causing the issue?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!