macosx-port-dev Digest, Vol 26, Issue 19
Mike Swingler
swingler at apple.com
Thu Feb 21 09:49:25 PST 2013
On Feb 21, 2013, at 8:10 AM, Jamison Hope <jrh at theptrgroup.com> wrote:
> On Feb 21, 2013, at 10:27 AM, Yannick Jestin <yannick.jestin at enac.fr> wrote:
>
>>> Then I wanted to execute the application JDownloader who asked for (Apple 1.6 ?) java.
>>>
>>> Then, I fired the terminal, typed java -version and get:
>>> No Java runtime present, requesting install.
>>>
>>> And I promptl saw a new window that asked if I wanted to install java se 1.6.
>>>
>>> What do I do wrong ?
>>
>> This has been discussed a few times on this mailing list, and google(java7 command line macosx). The java preference panel seems to have disappeared on Mountain Lion.
>>
>> if the apple provided java6 is not present on Mountain Lion, the standard behavior is to trigger the download, even there is Oracle java7 on your computer.
>>
>> The java command line then points to
>> $ which java
>> /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Commands/java
>>
>> If you want to use java7, with or without downloading apple java6, you can execute
>> $ export PATH=$(/usr/libexec/java_home)/bin:$PATH
>> $ which java
>> /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/bin/java
>
> I don't think that's entirely accurate. I've never installed Apple Java 6 on my ML machine and /usr/bin/java finds the newest Oracle Java 7 in /Library/Java/JavaVirtualMachines/ just fine, no PATH changes required:
>
> $ /usr/bin/java -version
> java version "1.7.0_15"
> Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
> Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
This exactly what should occur when you install an Oracle or OpenJDK in /Library/Java/JavaVirtualMachines from <http://www.oracle.com/technetwork/java/javase/downloads/index.html>. Yannick likely only installed the Java applet plug-in from <http://java.com/en/download/mac_download.jsp> with it's own embedded JRE which is not visible to the command-line.
> I don't recall having to do anything special the first time, either, but that was several months ago.
>
>
> OTOH, I do still see the occasional dialog asking me to install Java 6, I think that's triggered by applications that link against the deprecated JavaVM.framework or are otherwise incompatible with Java 7 (e.g. are 32-bit or have hard-coded dependencies on old paths).
This is correct. Apple is continuing to push developers to embed Java 7 and end users who need command-line tools to install an Oracle JDK.
Unfortunately, for backwards compatibility, we will still have to offer Java SE 6 for applications which link against the JavaVM.framework and do not provide their own Java 7. We are planning to make Java SE 6 a manual download only, and completely remove the install-on-demand experience, even for legacy apps.
Please, do seriously adopt Java 7, embed it in your application, and let Oracle know about any blocking issues.
Regards,
Mike Swingler
Apple Inc.
More information about the macosx-port-dev
mailing list