Forum Discussion

sverrem's avatar
sverrem
Brass Contributor
May 19, 2021

Silent install of OpenJDK MSI

I am trying to silent install an MSI in PowerShell.

 

Need silent install because I am doing it when building my Windows JDK11 docker image.

 

First download the AdoptOpenJDK OpenJDK 11

 

 

Invoke-WebRequest https://api.adoptopenjdk.net/v3/installer/latest/11/ga/windows/x64/jdk/hotspot/normal/adoptopenjdk?project=jdk -OutFile C:\Temp\openjdk11.msi

 

 

Trying with silent install:

 

 

Start-Process -Wait -FilePath msiexec -ArgumentList /i, "C:\Temp\openjdk11.msi", "ADDLOCAL=\"FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome\"", "INSTALLDIR=\"C:\Program Files\Java\"", /quiet

 

 

 

The install process just hangs there forever.

  • sverrem's avatar
    sverrem
    Brass Contributor
    The solutions was

    Start-Process -Wait -FilePath msiexec -ArgumentList /i, "C:\Temp\openjdk11.msi", "ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome", 'INSTALLDIR="C:\Program Files\Java"', /quiet -Verb RunAs