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: Compiling in older release of Java?



Gary Bradshaw wrote:

I'm using Xcode 2.0 (components release 514) on OS X 10.4.11.

That's an ancient Xcode. Don't use it.

You should upgrade to at least Xcode 2.4.1. It's a 932 MB download from ADC. Start with its ReadMe PDF, though.

If you upgrade to Xcode 2.5 (also a download from ADC), then you will also have to get used to using Ant and external build files (the "build.xml" I asked about). If you do upgrade to Xcode 2.5, then Rob Lockstone's discussion of how to use Ant effectively in Xcode is worth reading.

If you only upgrade to Xcode 2.4.1, then here's how to compile for JDK 1.3. (Some of what Rob wrote also applies here, especially the part about building against the actual 1.3 libraries.)

To set the target JVM version:

 1. Look under the "Groups & Files" list at left of project window.
 2. Expand the "Targets" item if it isn't already expanded.
 3. Double-click the target you find under expanded "Targets".
 4. A window will open.
 5. At left should be a hierarchical list, top-level items:
        Summary, Settings, Build Phases
 6. Expand Settings, then expand "Simple View".
 7. Choose "Java Compiler Settings".
 8. In pane on right, choose a Target VM version of 1.3.
 9. Also choose a Source version of 1.3.
 10. Close the window, then build.

In order to do what Rob said about compiling against the real 1.3 libraries, you have to add some text to the "Other Java Compiler Flags" text-box in the Java Compiler Settings.

-bootclasspath /System/Library/Frameworks/JavaVM.framework/ Versions/1.3/Classes/classes.jar

The reference for the above is the man page for 'javac', which you can read in Xcode 2.4.1 using "Open man page..." from its Help menu. It's the section of the man-page about cross-compiling.

If something above doesn't work, then ask again. Please be specific about what didn't work: post any error messages, describe what you did, what you expected, what actually happened, and so on. I'm assuming you're a reasonably experienced developer, and not a complete newbie to Java or IDE's or compilation in general. If that's not the case, please describe your experience level.

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