5 Replies Latest reply: Jan 17, 2013 11:42 PM by 984246 RSS

    Update Java 7 via command line?

    jnojr
      Looking for a way to kick off the updater for Java 7 under OS X.
        • 1. Re: Update Java 7 via command line?
          984793
          Not sure - We're certain such an option exists? I'll try to see what I can discover on a Windows machine which, I know, won't translate 1:1 on a unix/linux machine but its a step.
          • 2. Re: Update Java 7 via command line?
            jnojr
            981790 wrote:
            Not sure - We're certain such an option exists?
            Such an option SHOULD exist.

            Until it's found or implemented, my solution:


            REMOTEHOST=hostname

            scp jre-7u11-macosx-x64.dmg $REMOTEHOST:

            ssh $REMOTEHOST hdiutil attach ~/jre-7u11-macosx-x64.dmg

            ssh -t $REMOTEHOST "sudo installer -pkg \"/Volumes/Java 7 Update 11/Java 7 Update 11.pkg\" -target /"

            ssh $REMOTEHOST sudo rm /usr/bin/java

            ssh $REMOTEHOST "sudo ln -s \"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java\" /usr/bin/java"

            ssh $REMOTEHOST "hdiutil detach \`hdiutil info | grep \"Java 7 Update 11\" | cut -f1\`"

            ssh $REMOTEHOST rm jre-7u11-macosx-x64.dmg


            I'm assuming that running the Java 7 installer on a machine that already has an older version of Java 7 installed will wind up doing an update and not a side-by-side install. My assumption could be wrong, but it's all I have right now.
            • 3. Re: Update Java 7 via command line?
              984793
              I'm worried it will do a side by side install based two things:
              what [little] I've seen in our Java deployments (I remember seeing 6u21, 6u27, 6u35, 6u37 on machines that hat 7u9)
              the wording on this page: http://java.com/en/download/faq/remove_olderversions.xml

              I'm curious to know your findings. And thanks for sharing the script!
              • 4. Re: Update Java 7 via command line?
                gimbal2
                981790 wrote:
                I'm worried it will do a side by side install based two things:
                what [little] I've seen in our Java deployments (I remember seeing 6u21, 6u27, 6u35, 6u37 on machines that hat 7u9)
                The idea is to use the Java updater to update existing runtimes in stead of reinstalling new ones all the time. Then you'd have only one copy of Java 6 and only one copy of Java 7 at all times. That works great on a per machine basis.
                the wording on this page: http://java.com/en/download/faq/remove_olderversions.xml
                Yes that's a standard security related disclaimer. "If you have older versions lying around, you run some risk and we're not going to be held responsible for it" bla bla bla.

                The risk depends on those runtimes actually being used or not; if you have a Java 6 update 1 but no browser is configured to use its plugin, there is no issue. Its the browser sandbox that is full of holes, the actual runtime itself has little to do with all the hyperventilation about security risks going around.
                • 5. Re: Update Java 7 via command line?
                  984246
                  Browser sandbox ? what is it ? NP-API is just a mere DLL (LIB.SO) interface without any sandboxes. Dunno about MSIE JVM intf.

                  Browsers offer sandbox for JavaScript but this has nothing related to Java