5 min .msi and .zip

https://techoral.com/blog/java/adoptopenjdk-install-windows.html

.msi and .zip
Both versions of have the same functionality, features, plugins, etc.

The main difference is that the Zip file does not get installed in the system as a program,
meaning that the executable files are not in the programs folder.

The application does not appear on the start menu, or as part of the programs menu.
Also the operating system will not associate .java files to open automatically.

The zip file can be extracted to any folder you want, and the contained java.exe program can be run from there.
It can even be executed from an external drive, so that it can also be run on computers where the user has no access to modifying the operating system (in schools, public computers, your parent’s computer, etc).

The zip file allows you to use different versions of the program, whereas the installed version will use only the latest one installed.


The files used on the zip file don’t need to be uninstalled from the system, you can simply delete the containing folder.
To uninstall the .msi file you need to use the OS uninstall tools.

jdk-11 was installed with msi

cmd

C:\Users\username\java -version
openjdk version “11.0.13” 2021-10-19
OpenJDK Runtime Environment Temurin-11.0.13+8 (build 11.0.13+8)
OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

Now lets swap to the downloaded zip jdk-17

It is unzipped to the same folder as jdk-11 was installed in.

Lets run a jar file and then change the JAVA_HOME from

C:\Users\username\echo %JAVA_HOME%
C:\Program Files\Eclipse Adoptium\jdk-11.0.13.8-hotspot

cd c:\giti2021\Kotlins\testbasic
java -jar Main.jar
[]
Hello from VSC
12
WORKER1 28
Utility str
19
0.0667848
espen
silje
object pojo
Customer(name=object pojo, email=email@mil.com)

To

# cmd as admin
setx -m JAVA_HOME “C:\Program Files\Eclipse Adoptium\jdk-17.0.1+12”

Close and open cmd again (as admin if change back), run the same jar file

c:\Users\username\echo %JAVA_HOME%
C:\Program Files\Eclipse Adoptium\jdk-17.0.1+12
c:\giti2021\Kotlins\testbasic>java -jar Main.jar
[]
Hello from VSC
12
WORKER1 28
Utility str
85
0.36406016
espen
silje
object pojo
Customer(name=object pojo, email=email@mil.com)

Great, now we have installed jdk-11 but are using jdk-17.

How to set environment variables for Java using command line (codejava.net)

I will revert back to jdk-11.0.13.8-hotspot , the cmd output java -version will not change before we uninstall the installed jdk-11

Scroll to Top