Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode & NoClassDefFoundError



Matt wrote:

>I'm new to Xcode and the files I am using are straight up java rather than
>the cocoa-java bridge.  I've got an a simple block of code that runs fine
>in Eclipse 3.1.  I've created a Java Tool project in Xcode and added my
>files.

Are there any jars in the files you've added?


>"Exception in thread "main" java.lang.NoClassDefFoundError: javax/jms/Message"

That's a J2EE/JMS class.  J2EE isn't installed by default on Mac OS X.

If it's in a jar that Xcode is using by default, you'll have to find where
that jar is, then add it to your program's classpath.


>
>Now since it 1) Runs perfectly in Eclipse 2) Builds fine in Xcode, I am
>assuming there is a build setting in Xcode I am missing.  Does anyone have
>any suggestions?

If it runs perfectly in Eclipse, it's probably because Eclipse is setting
the classpath to include the J2EE/JMS jar.  Look at exactly what Eclipse is
doing to the classpath when it runs something.

If it builds fine in Xcode, it's because Xcode knows about a jar that has
the class in it.  I can't tell you which one it is, nor where Xcode is
finding it.  However, if the class is in a jar you added to your project,
then that's where Xcode is finding it.  The remedy is to either copy jars,
preset your classpath, or merge the jars into the output.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.