Advertisement

03.20.2008 at 11:58AM PDT, ID: 23258041
[x]
Attachment Details

java.lang.NoClassDefFoundError running from a jar

Asked by marklorenz in Java Programming Language, Eclipse, Windows Batch Scripting

Tags: Sun, Java, 1.4

OK, this should be trivial, but is driving me crazy.  I have an app that I built and tested in Eclipse. I then exported to a jar file.  This app depends on a set of other jars, such as xbean.jar.  So, I created a .bat file to run it:

set CLASSPATH=xbean.jar;xbean_xpath.jar;xmlbeans-qname.jar;RebalanceCalculator.jar;maprResultsXmlBeans.jar;maprPortfolioXmlBeans.jar;maprModelXmlBeans.jar;maprConstraintsXmlBeans.jar;.;jsr173_1.0_api.jar;
java -jar MaprXmlCmdLineClient.jar %1

When I run this bat file from a command line, it starts fine, but as soon as it references anything in another jar, I get a NoClassDefFoundError!  I have checked and this "missing" class is in the xbean.jar file that is in my CLASSPATH for this command prompt window.  

Any ideas what is causing this?!  Thanks...MarkStart Free Trial
[+][-]03.20.2008 at 12:36PM PDT, ID: 21175004

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Programming Language, Eclipse, Windows Batch Scripting
Tags: Sun, Java, 1.4
Sign Up Now!
Solution Provided By: CEHJ
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.20.2008 at 02:04PM PDT, ID: 21175860

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 02:52PM PDT, ID: 21176231

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 02:56PM PDT, ID: 21176255

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.20.2008 at 03:34PM PDT, ID: 21176577

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628