19 September 2020

Windows: which java version do I use?

 On windows oracle java uses quite a complicated way to find the java executable.

> echo %PATH%
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;...

Starting from javapath it uses quite a complex mechanism, which well explained in this stackoverflow answer.

Ultimately the windows registry is used, like I also explained earlier.

When you frequently have to hop from one Java version to another, it is a good idea to store the path to your java binaries in the JAVA_HOME environment variable and prepend that to your windows path.

No comments:

Post a Comment