Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How to change Java Home?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change Java Home?



Ok, so let me explain what we do right now.

- We only ship the JDK. There is no JDK/JRE difference on MacOSX.
- /Applications/Utilities/Java/Java Preferences.app lets you switch the java version used in applets and double-clickable bundled apps.
- Beginning Leopard, Java Preferences also affects the java used on the command line. If you set Java 6 as your preferred VM, the java/ javac used on the command line will use 1.6. If you set it to 1.4, well that's what you'll get.
- The ant javac task uses JAVA_HOME environment variable. It defaults to /System/Library/Frameworks/JavaVM.framework/Home if it doesn't find one.
- We do NOT set JAVA_HOME environment variable for you. You can file an enhancement request if you think we should.
- The CurrentJDK symlink in JavaVM.framework/Versions is controlled by Apple. Please do not change. It will always point to the preferred Java VM as decided by us. When we shipped Tiger, it pointed to 1.4. Later Java updates on Tiger changed that to 1.5. For Leopard, it points to 1.5.
- Note, again, that even though CurrentJDK points to 1.5, /usr/bin/ java will run the 1.6 java if you specify so in Java Preferences.


Hopefully, this helps clear things up.

Got some ideas to improve what we do? File a bug at <http://bugreporter.apple.com >.

Pratik

On Jun 24, 2008, at 9:13 AM, Kirk Mattson wrote:

Thanks Shawn (and everybody else, too). By the way, I appreciate both the
volume and friendly attitude of all the responses on this list.


The thing about the OSs is there is at least one difference between the mac
and others. And that difference is "Java Home." I don't know of another OS
gives you a concept like that. Since it only sort-of works (or, it works
most of the time but not all of the time), it leaves developers no other
choice but to write their own escape hatch, as the Ant folks did with the
tactic of the JAVA_HOME environment variable. According to the Technical Q&A
that describes "Java Home," they shouldn't have needed to do that. Which is
basically why I posted in the first place and why I felt like I must have
been missing something. But maybe I'm not- maybe nobody really understands
this "Java Home" thing any better than I do.


Kirk

On 6/24/08 8:14 AM, "Shawn Erickson" <email@hidden> wrote:

On Mon, Jun 23, 2008 at 10:26 PM, Kirk Mattson <email@hidden> wrote:
Yes, and maybe the difference between the mac and other OSs is part of it.

That is just it ... really no great difference exists between Java on Mac OS X and any other unix system (or Windows for that matter)

:)

Sure Apple includes a few versions of Java as part of the operating
system however the way that developers interact with Java (command
line tools, IDE, etc.) are basically the same as any other unix
system. The only real exception is the fact of the Java Perferences
tools which can be used to adjust which Java is used (personally I
don't use it to adjust things for my developer tools).

Like other unix systems you can use shell environment settings to
adjust what the tools, that you launch under that environment, will do
and/or you use fully qualified paths to the tools you wan to use. This
is what I do.. this way I know what is taking place. Using shell
environment settings also allows you to limit the affects of your
adjustments to just the tools / workflow you want adjusted (Java
Preferences is global).


-Shawn

_______________________________________________ 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

_______________________________________________ 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
References: 
 >Re: How to change Java Home? (From: Kirk Mattson <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.