Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: XCode compile problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode compile problems




On T 8 Jan, 2008, at 20:41 , Chad Junkermeier wrote:

Several days ago I posted a question about getting Java 6 to work with Xcode 3.0. I got several answers to my initial inquiry. I am still hoping to find an answer to my last post.

Chad

Begin forwarded message:

I am sorry if this is going to sound dumb (my previous experience with Xcode is using it as a text editor to do Fortran programming), but I don't know where to set the $JAVA_HOME environment variable.


I have looked in Project > Edit Project Settings > Build and I have double clicked on the target, but in neither place have I found $JAVA_HOME.

Thanks for your help.

Chad


As this was never answered completely, and as I have also been bitten by ant not automatically looking at the javac set by Java Preferences, here is the answer you were looking for:


Project->Edit Project Settings

go to the "build" tab

select the desired Configuration (usually Debug and Release) and Add User-Defined Settings (is in the gear icon button at the bottom left).
The Title will be JAVA_HOME (no $) and the Value the path to the desired location of java /System/Library/Frameworks/JavaVM.framework/ Versions/1.6/Home in 1.6 case.


Note: this is not the only method. Even if you set your Java Preferences to use 1.6, this does not seem to apply to the JDK. Indeed:

ls -l /System/Library/Frameworks/JavaVM.framework/Versions/

[...]
lrwxr-xr-x  1 root  wheel    5 Feb  6 12:26 1.5 -> 1.5.0
drwxr-xr-x  8 root  wheel  272 Feb  6 12:26 1.5.0
lrwxr-xr-x  1 root  wheel    5 Apr 30 10:20 1.6 -> 1.6.0
drwxr-xr-x  8 root  wheel  272 Apr 30 10:20 1.6.0
drwxr-xr-x  6 root  wheel  272 Apr 30 10:20 A
lrwxr-xr-x  1 root  wheel    1 Apr 30 10:20 Current -> A
lrwxr-xr-x  1 root  wheel    3 Apr 30 10:20 CurrentJDK -> 1.5

so, if you delete CurrentJDK and recreate a link to 1.6 as in:

cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm CurrentJDK
sudo ln -s 1.6 CurrentJDK

ant will compile fine for source and target 1.6 without having JAVA_HOME set as above.
I prefer though to have a less pervasive change.


Giuliano
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
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 © 2011 Apple Inc. All rights reserved.