4 Replies Latest reply: Oct 17, 2012 11:23 AM by Sebastien Stormacq
Sebastien Stormacq Level 1 Level 1 (65 points)

Java users - Warning

 

Today's Java update remove the Java Preferences applications.  There is no way to define a default JDK - platform wise.

The newer JDK installed will be the default.

 

The system does honor JAVA_HOME in command line.

 

"un homme averti en vaut deux"

 

Seb


iMac, OS X Mountain Lion
  • 1. Re: Java SE 6 update
    Mark Jalbert Level 5 Level 5 (4,475 points)

    I remember some talk about the Java Preferences.app going away. Besides the fact that it is gone are you experiencing problems? In OS X 10.6 the Java Preferences.app is still there after the lastest update.

  • 2. Re: Java SE 6 update
    Sebastien Stormacq Level 1 Level 1 (65 points)

    Problem is to select a JDK to start an IDE like NetBeans or IntelliJ, without haveing to go through the command line ...

    My question is : how to force a default, platform-wide JDK, now that Java Preferences is gone ?

     

    - alternatively - what was doing Java Preference behind the scene to switch default's JDK ?

     

    I saw a similar thread here ...

    https://discussions.apple.com/message/20044893#20044893

     

    But no answer so far

     

    Seb

  • 3. Re: Java SE 6 update
    Mark Jalbert Level 5 Level 5 (4,475 points)

    Let's see if I can answer this in reverse order. I'm not using 10.8, so I can't test anything.

     

    - alternatively - what was doing Java Preference behind the scene to switch default's JDK ?

    Java Preferences would set the default JDK and fallback JDK's for GUI applications needing java. Setting the environment variable JAVA_HOME.

     

    My question is : how to force a default, platform-wide JDK, now that Java Preferences is gone ?

    Without knowing any security concerns this could be attained by setting JAVA_HOME in /private/etc/launchd.conf or possibly /private/etc/launchd-user.conf.

     

    Problem is to select a JDK to start an IDE like NetBeans or IntelliJ, without haveing to go through the command line ...

    A double clickable .command shell script or something wrapped in applescript may be a current workaround.

  • 4. Re: Java SE 6 update
    Sebastien Stormacq Level 1 Level 1 (65 points)

    Mark,

     

    I am pretty sure Java Preferences was not only setting JAVA_HOME.  You can not change environment variables for already started process.  And Graphical application launched from Finder or the Dock had the new settings without loggin out and in again.

     

    I wonder how much /usr/libexec/java_home is partof the response

     

    sst:logs sst$ export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/

    sst:logs sst$ /usr/libexec/java_home -t CommandLine

    /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home

     

    I am not sure launchd can set global environment variable either ...

     

    I just subscribed to Apple's java-dev mailing list ... some interesting discussions on going.

     

    Seb