I’m trying to get the java installation location on Windows 10 with C# (.NET 4.6). I tried the solution https://stackoverflow.com/a/3038526/3366090 but it doesn’t work for me on windows 10. The Environment variable is not set and the registry solution isn't working either. I can follow the registry tree down to
“HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft”
BUT
“Java Runtime Environment”
always returns null. I checked it twice with regedit and the “Java Runtime Environment” registry folder exists and is filled with the installed java versions.
Btw: Same solution is working on win7,8,8.1 without any issues :/
Any ideas?
UPDATE
Looks like "OpenSubKey" can't open registry tree folders which include spaces. Tried some different folders with the same result.