FeaturedSCCM

Install Java JDK/JRE 212

In this post i am going show how to create a SCCM Application for Java JDK/JRe.

When you install java jdk 1.8.0_121, it will also install JRE 1.8.0_212. so we are killing two birds with one stone.

The steps to create sccm application is simple, i am just going to show you the batch file contents.

 

 

@Echo off
"%~dp0jdk-8u212-windows-x64.exe" /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" 
setx -m JAVA_HOME "C:\Program Files\Java\jdk1.8.0_212"
Setx path "%path%;%JAVA_HOME%/Bin"
echo %JAVA_HOME%


##############################
####Unisntall Old Version of JAVA JDK##########
###############################################
if exist "C:\Program Files\Java\jdk1.8.0_202" (
MsiExec.exe /X{64A3A4F4-B792-11D6-A78A-00B0D0180202} /qn
)

if exist "C:\Program Files\Java\jdk1.8.0_191" (
MsiExec.exe /X{64A3A4F4-B792-11D6-A78A-00B0D0180191} /qn
)

if exist "C:\Program Files\Java\jdk1.8.0_181" (
MsiExec.exe /X{64A3A4F4-B792-11D6-A78A-00B0D0180181} /qn
)


##############################
####Unisntall Old Version of JAVA jre (RunTime) ##########
###############################################
##version 191
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F32180191F0} /qn /norestart
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F64180191F0} /qn /norestart

##version 181
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F64180181F0} /qn /norestart
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F32180181F0} /qn /norestart

##version 171
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F32180171F0} /qn /norestart
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F64180171F0} /qn /norestart

##version 162
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F32180162F0} /qn /norestart
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F64180162F0} /qn /norestart


Exit /b 0

 

Show More

Related Articles

Back to top button