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 18, 2005, at 8:48 PM, email@hidden wrote:

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.
<snip stuff about the classpath>
Can you state explicitly how this is done?

For Java Tool and Java Swing Application project types, normally the magic steps include:


1. In an appropriate place in your project structure where you want your jar files listed, right click and choose Add->Existing Frameworks. Navigate to your jar file(s) and select them. Depending on your defaults and setup, you may want to select Relative to Project or Relative to Enclosing Group or your project may break when you move it to another machine.
2. In your project, under Targets, double-click your main target to open the target settings. In the target settings, under Info.plist Entries, go to Pure Java Specific and there is a section for Classpath. Click the plus button make a new entry for each jar that reads $JAVAROOT/<your jar name here>.
3. Right click the Build Phases section and choose New Build Phase- >New Copy Files Build Phase. In the Where dropdown, choose Java Resources, and then drag and drop your jar(s) into that box from the project file list.


That usually gets things working for me without having to merge jars, which takes forever. There may be an easier way, but I don't use Xcode much for Java, as I build and run all my pure Java apps in Eclipse.

Good luck,
Logan Allred
_______________________________________________
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
References: 
 >Re: Xcode & NoClassDefFoundError (From: 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.