Changes

Java

952 bytes removed, 10:59, 17 August 2011
Revised for Java 7 extensively - see discussion page
For security reasons you are encouraged to upgrade to the latest release. Bug Fixes of the Update Release Notes under each release: http://java.sun.com/javase/6/webnotes/ReleaseNotes.html. However, if you're running JRE 6 Update 10 or onwards and haven't disabled automatic updates then JRE should automatically be downloading and installing updates.
==Java Runtime Environment (JRE) 6=7=
===Installer Versions===
There are various versions of the installer:
* Those from http://www.oracle.com/technetwork/java/javase/downloads/index.html which are aimed at developers or ISVs. We want the 'Windows Offline Installation' version with a filename of jre-6u7-windows-i586.exe or jre-7u##-windows-i586.exeonce Java 7 has had updates issued.
* Those from http://www.java.com/en/download/manual.jsp which are aimed at consumers. The versions available here are 'Windows 7/XP/Vista/2000/2003/2008 Online' (same as the 'Windows Online Installation' above) (jre-6u237-windows-i586-iftw-rv.exe) and 'Windows 7/XP/Vista/2000/2003/2008 Offline' (not the same as the 'Windows Offline Installation' above) (jre-6u237-windows-i586-s.exe). In versions releases prior to version 6 update 19 or maybe 18 the installer filename ending in -s.exe tried to download the Google Toolbar so this may still be the case with this version.
=== JRE on 32-bit Hosts === The following installs the JRE and then removes the "Java Quick Starter" service; if you want to keep "Java Quick Starter" service then just remove the line with "jqs.exe -unregister", but remember to stop/kill JQS before uninstallation. You will need to rename the installer file you downloaded to reflect that this is update 00 since Sun are being inconsistent in naming their executable files. <source lang="xml"><package id="java7" name="Java Runtime Environment 7" revision="%version%" reboot="false" priority="100">  <variable name="version" value="00" />  <check type="logical" condition="or"> <check type="uninstall" condition="exists" path="Java(TM) 7 Update %version%" /> <check type="uninstall" condition="exists" path="Java(TM) 7" /> </check>  <install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'> <exit code='0' /> <exit code='1' /> <exit code='128' /> </install> <install cmd='%SOFTWARE%\jre\jre-7u%version%-windows-i586.exe /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1' /> <!-- remove Java Quick Starter --> <install cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'> <exit code='1' /> </install> <install cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'> <exit code='1' /> </install> <!-- Remove Java Auto Updater software --> <install cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' />  <upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' > <exit code='0' /> <exit code='1' /> <exit code='128' /> </upgrade> <upgrade cmd='%SOFTWARE%\jre\jre-7u%version%-windows-i586.exe /s REBOOT=Suppress IEXPLORER=1 MOZILLA=1' /> <!-- remove Java Quick Starter --> <upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES%\Java\jre7\bin\jqs.exe" -unregister'> <exit code='1' /> </upgrade> <upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre7\bin\jqs.exe" -unregister'> <exit code='1' /> </upgrade> <!-- Remove Java Auto Updater software --> <upgrade cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' />  <remove cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F832160%version%FF}' /></package></source> ===Install JRE with msi without removing old version in a mixed 32-bit/64-bit environment=== On 64-bit hosts installing the exe doesn't work: the silent install on a 64-bit host is still looking for the msi in the *System32* directory, so the best thing to do is to install the msi package. * jre-7-windows-i586.exe is the 32bit installer containing a msi, a cab and some other files.* jre-7-windows-x64.exe is a 64bit version of the above. Run the installer without going any further, then find the extracted directory: * On Windows XP and possibly others, it extracts to %APPDATA%\Sun\Java\jre1.7\.* On a 32-bit host it extracts to c:\Windows\system32\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.7\.* On a 64-bit host it extracts to c:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.7\. Copy the content of the unpacked directory onto your server and install from it. You should install both 32-bit and 64-bit java on 64-bit machines if you want a 32-bit browser being able to use java. In this example, no uninstall of the old java versions as it is quite time consuming. <source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <packages><!-- jre install with the msi ; for 32-bit and 64-bit hosts --><package id="jre" name="Java(TM) 7" revision="%version%" reboot="false" priority="178" > <variable name="updatever" value="00" /> <variable name="version" value="7.0.0.147" /> <variable name="autoupdate" value="0" />  <check type="logical" condition="or"> <check type="uninstall" condition="exists" path="Java(TM) 7 Update %updatever%" /> <check type="uninstall" condition="exists" path="Java(TM) 7" /> </check>  <install cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.7.0_u%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' /> <!-- Remove Java Auto Updater software --> <install cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' />  <upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' > <exit code='0' /> <exit code='1' /> <exit code='128' /> </upgrade> <upgrade cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.7.0_u%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' /> <!-- Remove Java Auto Updater software --> <upgrade cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' /> </package> <!-- jre 64-bit install with the msi ; for 64-bit hosts only --><package id="jre-64" name="Java(TM) 6 Update 26" revision="%version%" reboot="false" priority="178" > <variable name="updatever" value="00" /> <variable name="version" value="7.0.0.147" /> <variable name="autoupdate" value="0" />  <check type="logical" condition="or"> <check type="uninstall" condition="exists" path="Java(TM) 7 Update %updatever% (64-bit)" /> <check type="uninstall" condition="exists" path="Java(TM) 7 (64-bit)" /> </check> <install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'> <exit code='0' /> <exit code='1' /> <exit code='128' /> </install> <install cmd='msiexec /qn /i %SOFTWARE%\jre-64\jre1.7.0_u%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' /> <!-- Remove Java Auto Updater software --> <install cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' />  <upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' > <exit code='0' /> <exit code='1' /> <exit code='128' /> </upgrade>  <upgrade cmd='msiexec /qn /i %SOFTWARE%\jre-64\jre1.7.0_u%updatever%.msi REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1' /> <!-- Remove Java Auto Updater software --> <upgrade cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' /> </package> </packages></source> == Disable Automatic Update == === JRE 6 Update 18 and Newer === Since approximately 1.6.18 / 6.0 update 18, Sun has included Java Auto Updater as a separate package that is automatically installed with the JRE. You can disable automatic updates by uninstalling the Java Auto Updater after the JRE is installed or upgraded, by adding the following to your package definition: <source lang="xml"><install cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' /><upgrade cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' /></source> =Older Versions= ==Uninstalling Old Versions===
Older versions of Java did not uninstall themselves when new versions were installed. These older versions can pose a security risk even with newer versions installed. Older versions should be uninstalled unless they are required for some reason. Attempting to uninstall every old version of Java in the package definition can be very slow. Only include these uninstall commands in your package definition if there is a possibility that clients will have the older Java versions.
</source>
===Java Quick Starter=instructions for JRE version 6==
"Java Quick Starter" is described as a prefetching service that should make java applications start faster. But it has a drawback: it must be killed before uninstallation or installation fails, and uninstallation via msiexec using versions older than JRE 7 does not seem to be smart enough to do this.
This is not a problem though, simply insert the following snippet into the very first of your install AND upgrade commands of the xml from the next paragraph.
-logfile <logfile> set JQS log file
-verbose <level> verbose operation
 
This requires the Windows Offline installation package available from Sun. Note that a particular Java family install package does not remove already installed versions of another Java family, so JRE 1.5 and JRE 1.6 can coexist; all older 1.6 update versions (1.6.0 up to but not including the most recent version) are uninstalled by the following packaging (note that the update version seems to be no more reflected in the last number in the Uninstall ID).
Patch-in-place sometimes fails with "Error 25099. Unzipping core files failed", returning error code 1603 from msiexec. Sometimes installation will succeed on a later reboot without any intervention, but sometimes it continues to fail. As of December 2010, the root cause is not known, but Sun/Oracle suggests (at http://www.java.com/en/download/help/error_25099.xml) removing %PROGRAMFILES%\Java\jre6 before retrying installation. A fully-automatic workaround requires the ability to execute commands in response to particular error codes and thus may need to take the form of a batch program wrapped around msiexec.
=== Disable Automatic Update =Installer Command-line Switches ==
http://java.sun.com/javase/6/webnotes/install/jre/silent.html gives the following list for Java version 6 but it may or may not be complete:* /lang=<language ID>, if used, sets the localized language for the installer (see language IDs)* /s, if used, specifies a silent installation* INSTALLDIR, if used, specifies the drive and path of the installation* If INSTALLDIR is not specified, the installation will go into C:\Program Files\java\jre6 (default location).* REBOOT==== Suppress, if used, indicates that if locked files are encountered the computer should not be rebooted. Most JRE 6 Update 18 and Newer ===installations will not ask for a reboot.* STATIC=1, if used, specifies a static installation. The default is for a Family installation.* SYSTRAY=0, if used, if set to zero, Java won't show an systray icon when loaded.
Since approximately 1.6.18 / 6.0 update 18, Sun has included Java Auto Updater as a separate package that is automatically installed with the JRE. You can disable automatic updates by uninstalling the Java Auto Updater after the JRE is installed or upgraded, by adding the The following to your package definitionswitches are deprecated for JRE 6 Update 10 and higher:* IEXPLORER=1* MOZILLA=1* ADDLOCAL=ALL* JAVAUPDATE=0* JU=0* AUTOUPDATECHECK=0
<source lang="xml"><install cmd=From the 'msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}Java SE 6 Update 10 Release Notes' />:<upgrade cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' /></source>"Windows Regression when Using MSI Install Options
On Windows XP Pro SP3 (32bits), when installing JRE 6u10 or later and using MSI install options /qb or /passive, installation fails with Error 1606.Could not access network location 0..The workaround is to not use the /qb or /passive options.Options that work correctly are /q, /qn (no UI), /qr (reduced UI), and /quiet (quiet mode, no user interaction).See [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6764967 6764967] for details." ==== Older Versions ===Disable Automatic Update - older versions ==
Automatic updates can be disabled with JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0; if these command line switches should not work for you, then you can alter the registry (read [[Adding Registry Settings]] for that) to disable autoupdate:
<install cmd='MsiExec.exe /qn /i "%SOFTWARE%\Java1.6\jre1.6.0_18.msi" ADDLOCAL=ALL REBOOT=Suppress JAVAUPDATE=0 JU=0 AUTOUPDATECHECK=0'/>
</source>
 
=== JRE on 32-bit Hosts ===
 
The following installs the JRE and then removes the "Java Quick Starter" service; if you want to keep "Java Quick Starter" service then just remove the line with "jqs.exe -unregister", but remeber to stop/kill JQS before uninstallation.
 
<source lang="xml">
<package
id="java6"
name="Java Runtime Environment 6"
revision="%version%"
reboot="false"
priority="100">
 
<variable name="version" value="26" />
 
<check type="uninstall" condition="exists" path="Java(TM) 6 Update %version%" />
 
<install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='0' />
<exit code='1' />
<exit code='128' />
</install>
<install cmd='%SOFTWARE%\jre\jre-6u%version%-windows-i586.exe /s REBOOT=Suppress' />
<install cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</install>
<install cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</install>
<install cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' />
<upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' >
<exit code='0' />
<exit code='1' />
<exit code='128' />
</upgrade>
<upgrade cmd='%SOFTWARE%\jre\jre-6u%version%-windows-i586.exe /s REBOOT=Suppress' />
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</upgrade>
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</upgrade>
<upgrade cmd='msiexec /qn /x {4A03706F-666A-4037-7777-5F2748764D10}' />
 
<remove cmd='msiexec /qn /x {26A24AE4-039D-4CA4-87B4-2F832160%version%FF}' />
</package>
</source>
 
===Install JRE with msi without removing old version in a mixed 32-bit/64-bit environment===
 
On 64-bit hosts installing the exe doesn't work: the silent install on a 64-bit host is still looking for the msi in the *System32* directory, so the best thing to do is to install the msi package.
 
* jre-6u26-windows-i586.exe is the 32bit installer containing a msi, a cab and some other files.
* jre-6u26-windows-x64.exe is a 64bit version of the above.
 
Run the installer without going any further, then find the extracted directory:
 
* On Windows XP and possibly others, it extracts to %APPDATA%\Sun\Java\jre1.6.0_26\.
* On a 32-bit host it extracts to c:\Windows\system32\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_26\.
* On a 64-bit host it extracts to c:\Windows\SysWOW64\config\systemprofile\AppData\LocalLow\Sun\Java\jre1.6.0_26\.
 
Copy the content of the unpacked directory onto your server and install from it.
 
You should install both 32-bit and 64-bit java on 64-bit machines if you want a 32-bit browser being able to use java.
 
In this example, no uninstall of the old java versions as it is quite time consuming.
 
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<packages>
<!-- jre install with the msi ; for 32-bit and 64-bit hosts -->
<package
id="jre"
name="Java(TM) 6 Update 26"
revision="%version%"
reboot="false"
priority="178"
>
<variable name="updatever" value="26" />
<variable name="version" value="6.0.260.3" />
<variable name="autoupdate" value="0" />
 
<check type="logical" condition="or">
<check
type="uninstall"
condition="exists"
path="Java(TM) 6 Update %updatever%"
/>
<check
type="registry"
condition="equals"
path="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F832160%updatever%FF}\DisplayName"
value="Java(TM) 6 Update %updatever%"
/>
<check
type="file"
condition="versiongreaterorequal"
path="%PROGRAMFILES(x86)%\Java\jre6\bin\java.exe"
value="%version%"
/>
<check
type="file"
condition="versiongreaterorequal"
path="%PROGRAMFILES%\Java\jre6\bin\java.exe"
value="%version%"
/>
</check>
 
<install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='0' />
<exit code='1' />
<exit code='128' />
</install>
<install
cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.6.0_%updatever%.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
/>
<install cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</install>
<install cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</install>
 
<upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' >
<exit code='0' />
<exit code='1' />
<exit code='128' />
</upgrade>
<upgrade
cmd='msiexec /qn /i %SOFTWARE%\jre\jre1.6.0_%updatever%.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
/>
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</upgrade>
<upgrade cmd='%COMSPEC% /C if exist "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" "%PROGRAMFILES(x86)%\Java\jre6\bin\jqs.exe" -unregister'>
<exit code='1' />
</upgrade>
 
</package>
 
<!-- jre 64-bit install with the msi ; for 64-bit hosts only -->
<package
id="jre-64"
name="Java(TM) 6 Update 26"
revision="%version%"
reboot="false"
priority="178"
>
<variable name="updatever" value="26" />
<variable name="version" value="6.0.260.3" />
<variable name="autoupdate" value="0" />
 
<check type="logical" condition="or">
<check
type="registry"
condition="equals"
path="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE"
value="x86"
/>
<check
type="uninstall"
condition="exists"
path="Java(TM) 6 Update %updatever% (64-bit)"
/>
<check
type="registry"
condition="equals" path="HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F832160%updatever%FF}\DisplayName"
value="Java(TM) 6 Update %updatever% (64-bit)"
/>
<check
type="file"
condition="versiongreaterorequal"
path="%PROGRAMFILES%\Java\jre\bin\java.exe"
value="%version%"
/>
</check>
 
<install cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe'>
<exit code='0' />
<exit code='1' />
<exit code='128' />
</install>
<install
cmd='msiexec /qn /i %SOFTWARE%\jre-64\jre1.6.0_%updatever%.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
/>
 
<upgrade cmd='taskkill /f /im jqs.exe /im iexplore.exe /im firefox.exe' >
<exit code='0' />
<exit code='1' />
<exit code='128' />
</upgrade>
<upgrade
cmd='msiexec /qn /i %SOFTWARE%\jre-64\jre1.6.0_%updatever%.msi ADDLOCAL=ALL REBOOT=Suppress IEXPLORER=1 MOZILLA=1 JAVAUPDATE=%autoupdate% CUSTOM=1'
/>
 
</package>
 
</packages>
</source>
 
=== Installer Command-line Switches ===
 
http://java.sun.com/javase/6/webnotes/install/jre/silent.html gives the following list but it may or may not be complete:
* /lang=<language ID>, if used, sets the localized language for the installer (see language IDs)
* /s, if used, specifies a silent installation
* INSTALLDIR, if used, specifies the drive and path of the installation
* If INSTALLDIR is not specified, the installation will go into C:\Program Files\java\jre6 (default location).
* REBOOT=Suppress, if used, indicates that if locked files are encountered the computer should not be rebooted. Most JRE installations will not ask for a reboot.
* STATIC=1, if used, specifies a static installation. The default is for a Family installation.
* SYSTRAY=0, if used, if set to zero, Java won't show an systray icon when loaded.
 
The following switches are deprecated for JRE 6 Update 10 and higher:
* IEXPLORER=1
* MOZILLA=1
* ADDLOCAL=ALL
* JAVAUPDATE=0
* JU=0
* AUTOUPDATECHECK=0
 
From the 'Java SE 6 Update 10 Release Notes':
"Windows Regression when Using MSI Install Options
 
On Windows XP Pro SP3 (32bits), when installing JRE 6u10 or later and using MSI install options /qb or /passive, installation fails with Error 1606.Could not access network location 0..
The workaround is to not use the /qb or /passive options.
Options that work correctly are /q, /qn (no UI), /qr (reduced UI), and /quiet (quiet mode, no user interaction).
See [http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6764967 6764967] for details."
 
=Older Versions=
==Java Runtime Environment (JRE) 6 Update 10==
60
edits