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




On Oct 13, 2005, at 6:34 PM, email@hidden wrote:

Message: 11
Date: Thu, 13 Oct 2005 13:16:00 -0700
From: Greg Guerin <email@hidden>
Subject: Re: Xcode & NoClassDefFoundError
To: email@hidden
Message-ID: <l03130304bf742ef3a95a@[209.63.214.174]>
Content-Type: text/plain; charset="us-ascii"

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?

Yes. There is one jar used in this project. I've added it to my project and in my target settings, under "Link Binary With Libraries" I've selected "Merge". This seems to have solved my problem and now my app will run. The only drawback (and its a big one) is that building time has increased exponentially. So I am looking for other options, if there are any.



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

Can you state explicitly how this is done?


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.

Like I said above, merging the jars does indeed work but the build time is ridiculous. Any further suggestions would be greatly appreciated. Thank you for your earlier suggestions!


-m



-- 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.