Updating java, what happens to the old java

Comments

4 comments

  • König, Tommy

    Hi Jason,

    i could solve that problem with a batch. Just add a install step and use this following .bat.

    You have to adjust with every release the version, and replace the java.msi.

    regards, tommy

     

     

     

    @ECHO OFF

    ::Check Current Version here
    IF EXIST "C:\Program Files (x86)\Java\jre1.8.0_71" goto END

    ::uninstall you older versions here if current version is not installed

    wmic product where "name like 'Java 2%%'" call uninstall /nointeractive
    wmic product where "name like 'Java 6%%'" call uninstall /nointeractive
    wmic product where "name like 'Java 7%%'" call uninstall /nointeractive
    wmic product where "name like 'Java 8%%'" call uninstall /nointeractive
    wmic product where "name like 'JavaFX%%'" call uninstall /nointeractive
    wmic product where "name like 'Java(TM) 7%%'" call uninstall /nointeractive
    wmic product where "name like 'Java(tm) 6%%'" call uninstall /nointeractive
    wmic product where "name like 'Java(tm) 8%%'" call uninstall /nointeractive
    wmic product where "name like 'J2SE Runtime Environment%%'" call uninstall /nointeractive


    ::Install Current Version here
    msiexec /i \\your-path\jre1.8.0_71.msi /qn

    :END
    exit

    0
    Comment actions Permalink
  • König, Tommy

    i wouldnt install a newer java, if a few clients need a older versions for some special applications.

    If u need java 6.0.46 asex, edit this .bat:

    IF EXIST "C:\Program Files (x86)\Java\jre1.6.0_46" goto END

    IF EXIST "C:\Program Files (x86)\Java\jre1.8.0_71" goto END

     

    we have the same situation here, cause some of our heavy metal machines (or our HiPath), need legacy versions of java.

    You can really easy edit this .bat for every situation.

     

    0
    Comment actions Permalink
  • Jason Szost

    Much appreciated. I am well aware of Java vulnerabilities and risks of upgrading to new versions but I am not in the position ATM to make the call. I get my orders and then proceed. 

    0
    Comment actions Permalink
  • Thomas Hilburn

    On the command line for these machines you need to add STATIC=1 That will keep the old ones installed

     

    http://docs.oracle.com/javase/8/docs/technotes/guides/install/config.html#table_config_file_options

    0
    Comment actions Permalink

Please sign in to leave a comment.