How to install Sun Java silently using SCCM

The following process has been tested and confirmed as working with Java Runtime Environment version 8 and SCCM R2.

It does the following tasks:

  • Installs Sun Java silently
  • Installs Internet Explorer extension
  • Installs Firefox extension
  • Disables automatic updates
Having troubles with the instructions?   Take a look at our example download.
Full Download: JavaSilentInstall.zip

 

  1. Download standalone (offline) installer for both 32-bit and 64-bit Windows for Java from www.java.com/en/download/manual.jsp
  2. SCCM-SunJava1
  3. Create a text file called install.cmd and copy in the following information
@echo off
cls
echo --------------------------------------------------------
echo .
echo .
echo .      Installing Java Runtime Environment - Please Wait.
echo .         (This window will close once installed)
echo .

REM Installing JRE 32-bit
"%~dp0jre-8u131-windows-i586.exe" INSTALL_SILENT=1 STATIC=0 AUTO_UPDATE=0 WEB_JAVA=1 WEB_ANALYTICS=0 EULA=0 REBOOT=0

REM If 64-bit Windows JRE 64-bit is also required
REM Installing JRE 64-bit
if exist "%ProgramFiles(x86)%\" "%~dp0jre-8u131-windows-x64.exe" INSTALL_SILENT=1 STATIC=0 AUTO_UPDATE=0 WEB_JAVA=1 WEB_ANALYTICS=0 EULA=0 REBOOT=0

REM Disable automatic updates
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SunJavaUpdateSched /f
reg add "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
  1. Copy the installer files and install.cmd to your software package share
  2. You can now create your SCCM package or deploy the software by using install.cmd.

 

For more information on creating SCCM packages see SCCM – How to Distribute Software Packages.

Tagged in

17 comments on “How to install Sun Java silently using SCCM

  1. Those of you who have had problems with partial uninstalls of previous Java versions, I feel your pain and I have a fix that will save you from reimaging your workstations.

    The problem is that the data in the %programfiles%javajre6 has been mangled. Copy the contents of this directory from a working system and you should then be able to uninstall successfully.

    I zipped a copy from one of my workstations and made a vbs to extract it into the broken jre6 folders. It’s worked perfectly across the board.

  2. i think the command line is not correct. update 26 is not an msi installation anymore, so the /v… does not do anything.
    also, the environment variable %EXIT_CODE% is not defined anywhere nor is it a standard os variable, so it is empty all the time.

  3. Appeared to work ok. However the AutoUpdate feature did not work. I modified the script by removing the AutoUpdate=0 from the install flags and added the following entry after the reg delete line:-
    reg add “HKEY_LOCAL_MACHINESoftwareJavaSoftJava UpdatePolicy” /v EnableJavaUpdate /t REG_DWORD /d 0 /f
    This then worked fine.

Leave a Comment

Your email address will not be published. Required fields are marked *