Mac JDK Version


macrumors 65816
Mar 13, 2005
ryan42 said:
Is there any way I can compile with JDK 1.5 (J2SE 5.0) through XCode? Thanks.
Ye, and to compile in 1.5 full stop! I know you have to invoke 1.5 as the prefered over 1.4, but how exactly. Apple site says:
To use the J2SE 5.0 version of any command-line Java utility, such as java or javac, specify the full path to the J2SE 5.0 version of the command. This usually means prepending the command with the path /System/Library/Frameworks/JavaVM.framework/Versions/1.5/.
...someone translate this for dummies? would one do this exactly?!

I imagine if we both knew how to do this then it would apply for xcode too??...

I know no one has read or replied to this thread for ages...any help would be appreciated! Sorry for dragging it up again...I'm doing a search through any thread I can find to try and find my solution!!


Moderator emeritus
Jul 24, 2002
The quote above means that for every command you want to use JDK1.5 for you need to preface it with the path supplied. This is not a do it once then it's set operation. It's a do it every single time operation. So to compile a single Java file you would do (in Terminal)

/System/Library/Frameworks/JavaVM.framework/Versions/1.5/javac (maybe not, you probably need stuff betweeb 1.5 and javac, but I'm not on a Mac right now) filename.

It might be possible to tell XCode to use this on a project by project basis...


macrumors member
Oct 23, 2004
Chapel Hill, NC
robbieduncan said:
The answer on setting up a new template for XCode to use Java 1.5 is here. Google is your friend! Note I've not tried this....
I used the process linked to here to get Eclipse running on 1.5. Just my 2 cents.