Which JRE does C:\ProgramData\Oracle\Java\javapath\java.exe use?

As of 2018, and specifically with regards to Oracle Java, you might find your Java runtime installed in one of two ways:

Regular Directory with File Symlinks inside

If you look at the files in C:\ProgramData\Oracle\Java\javapath\ you will see that they are actually symlinks to specific java binaries.

2015-11-13  06:11 PM    <SYMLINK>      java.exe [C:\Program Files\Java\jre1.8.0_65\bin\java.exe]
2015-11-13  06:11 PM    <SYMLINK>      javaw.exe [C:\Program Files\Java\jre1.8.0_65\bin\javaw.exe]
2015-11-13  06:11 PM    <SYMLINK>      javaws.exe [C:\Program Files\Java\jre1.8.0_65\bin\javaws.exe]

Directory Junction with regular Files inside

Using the latest (64! bit) install of Java 8 actually prepends onto the system path another location: c:\Program Files (x86)\Common Files\Oracle\Java\javapath.
This time, the javapath itself is the junction:

2018-07-21  05:59 PM    <JUNCTION>     javapath [C:\Program Files (x86)\Common Files\Oracle\Java\javapath_target_172906453]
2018-07-21  05:59 PM    <DIR>          javapath_target_172906453

And now, interestingly, the java.exe etc. in the javapath_target_… folder are not symlinks. These files find JRE and JDK versions using this registry location:

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment]
"CurrentVersion"="1.8"

[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\1.8]
"JavaHome"="C:\\Program Files\\Java\\jre1.8.0_65"

Leave a Comment