Announcement

Collapse
No announcement yet.

Toggling Java Web Start version on OSX

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Toggling Java Web Start version on OSX

    Hi all,

    many of you have two versions of Java installed on your system, namely
    Java 6 as distributed by Apple and Java 7 as distributed by
    Oracle. When installing Java 7, it will take over the place from Java
    6 as the Java component on the system and it's not possible to easily toggle
    between the two.

    To make this easier for everyone, I've written a script which toggles
    the Java Web Start version. It switches between using Java 6 and Java
    7 (if you've got these two installed).

    You use it as follows:
    1) Open your Terminal and type these commands to install the
    command:
    Code:
    $ cd ~/Downloads/                                   
    $ curl -s https://raw.github.com/skybert/my-little-friends/master/bash/osx/toggle-javaws-version.sh > toggle-javaws-version.sh
    $ chmod +x toggle-javaws-version.sh
    2) You are now ready to run it:
    Code:
    $ ./toggle-javaws-version.sh                       
    Java web Start uses Java 6, changing it to Java 7 ...
    Enter your password to change the Java version      
    Password:                                           
    Java web start version updated successfully :-)
    You can run the script as many times as you like to toggle between the two versions of Java Web Start.

    Enjoy!

    -Torstein

  • #2
    Really nice.

    Thanks!

    Comment


    • #3
      After running this script it declares that everything is fine.
      However, when I try to run "javaws" I get the error message:
      Code:
      Can not find message file: No such file or directory
      Any suggestions?

      Comment


      • #4
        To specify: I ran this script to switch from Java 7 to Java 6 since we are currently running Ece 5.1. Java 7 did an auto update this morning.

        Comment


        • #5
          see: https://discussions.apple.com/thread...art=0&tstart=0 perhaps a permissions problem?

          Comment


          • #6
            or this: https://discussions.apple.com/message/21090693#21090693 (which is to say we are seeing the same problem here)

            Comment


            • #7
              So running the command:

              sudo /usr/libexec/PlistBuddy -c "Delete :JavaWebComponentVersionMinimum" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta. plist

              (from the previously linked apple thread) seems to have done the trick here and we have a working Content Studio on a mac again

              Comment


              • #8
                It seems Apple has updated Xprotect anti-malware, stopping all Java Web Components with a version number below 1.6.0_37-b06-435. Unfortunately, this Java version is not yet available.

                From /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist:

                Code:
                <key>JavaWebComponentVersionMinimum</key>
                <string>1.6.0_37-b06-435</string>
                and

                Code:
                <key>com.oracle.java.JavaAppletPlugin</key>
                <dict>
                        <key>MinimumPlugInBundleVersion</key>
                        <string>1.7.11.22</string>
                </dict>
                Thanks to Carl-Oskar Westman at Gota Media for pointing out this.

                Comment


                • #9
                  and if you want to disable Java 7 and re-enable the Apple-provided Java SE 6 plug-in

                  These steps are what you need:

                  http://support.apple.com/kb/HT5559

                  -Erich

                  Comment


                  • #10
                    I tried juggling the permissions as explained above, but I still got the message "Can not find message file: No such file or directory". I ended up re-installing java 6 which I downloaded from Apple (http://support.apple.com/kb/DL1572). That worked.

                    I'm not sure it will work out of the box or if you need to do the permissions thing as well.

                    If you require java in your browser (like BankId) you will probably get a security warning after doing this
                    Last edited by Ted; 02-01-2013, 08:48 AM.

                    Comment


                    • #11
                      Hi Ted,

                      Are you saying that you performed the steps to re-enabled Java RE Web Start
                      http://support.apple.com/kb/HT5559 and didn't work?

                      Originally Posted by Ted View Post
                      I tried juggling the permissions as explained above, but I still got the message "Can not find message file: No such file or directory".
                      -Erich

                      Comment


                      • #12
                        Hi Erich,

                        What I did was:
                        1. Run the toggle script
                        2. Got the error message: "Can not find message file: No such file or directory"
                        3. Tried unblocking java6 in the XProtect.meta.plist
                        4. No luck. Same error message
                        5. Installed Java 6 again


                        I tried googling the "Can not find message file: No such file or directory" message, but all I could find was "Java 6 must be corrupted, reinstall"

                        Last time Java 7 was updated and disabled Java 6 (sometime autumn 2012), I tried the steps outlined in http://support.apple.com/kb/HT5559 and they worked. But this time, after running the toggle script, some of those commands give an error message when creating the folders.

                        Comment


                        • #13
                          Hi Ted,

                          Thank for the clarification.

                          Also, an update to the Apple Developer 1.6.0_38 should solve the problem.

                          Regards,

                          Erich

                          Comment


                          • #14
                            Originally Posted by chrlov View Post
                            It seems Apple has updated Xprotect anti-malware, stopping all Java Web Components with a version number below 1.6.0_37-b06-435. Unfortunately, this Java version is not yet available.

                            From /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist:

                            Code:
                            <key>JavaWebComponentVersionMinimum</key>
                            <string>1.6.0_37-b06-435</string>
                            and

                            Code:
                            <key>com.oracle.java.JavaAppletPlugin</key>
                            <dict>
                                    <key>MinimumPlugInBundleVersion</key>
                                    <string>1.7.11.22</string>
                            </dict>
                            Thanks to Carl-Oskar Westman at Gota Media for pointing out this.
                            Here's a workaround for this problem (at least it worked for me on Mac OS 10.7.5): http://forums.macrumors.com/showpost...5&postcount=28

                            In short:

                            To re-enable Java 6:

                            Code:
                            sudo /usr/libexec/PlistBuddy -c "Delete :JavaWebComponentVersionMinimum" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist
                            To re-enable Java 7:

                            Code:
                            sudo vi "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist"
                            and change 1.7.11.22 to 1.7.11.19

                            Comment


                            • #15
                              After some testing it seems that running
                              Code:
                              sudo /usr/libexec/PlistBuddy -c "Delete :JavaWebComponentVersionMinimum" /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/XProtect.meta.plist
                              does indeed work. However, there was a space between the last '.' and 'plist' in post #7 which caused the command to fail

                              Comment

                              Working...
                              X