- I've removed all ancient Java 8 install on my computer.
- I've downloaded latest openjdk 11 from [https://jdk.java.net/11/]( 5 ) and extracted the content to `C:\Program Files\Java\`.
-
I've setup system variable d'environnement to
```
JAVA_HOME = C:\Program Files\Java\jdk-11.0.1
```
and added `%JAVA_HOME%\bin` to Path.
-
In a invite de commandes `> java -version` returns:
```
Error: opening registry key 'Software\JavaSoft\Java Runtime Environment'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
```
-
Why?
On Windows, why java -version return Erreur: ouverture registre key 'Software\JavaSoft\Java Exécutertime Environment'?
Re: On Windows, why java -version return Erreur: ouverture registre key 'Software\JavaSoft\Java Exécutertime Environment'?
Comment make it work:
Windows > Start > cmd >
```
C:> for %i in (javac.exe) do @echo. %~$PATH:i
```
or
```
C:> where java
```
It returns `C:\ProgramData\Oracle\Java\javapath` folder which contain:
- java.exe
- javaw.exe
- javaws.exe
Browse to this folder with Windows file explorer and remove everything (three files above).
Close and reopen cmd (Windows > Start > cmd >)
```
C:> java -version
```
Should now return:
>
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
or something similar depending on which java release package you've downloaded...
Ça fonctionne!
Windows > Start > cmd >
```
C:> for %i in (javac.exe) do @echo. %~$PATH:i
```
or
```
C:> where java
```
It returns `C:\ProgramData\Oracle\Java\javapath` folder which contain:
- java.exe
- javaw.exe
- javaws.exe
Browse to this folder with Windows file explorer and remove everything (three files above).
Close and reopen cmd (Windows > Start > cmd >)
```
C:> java -version
```
Should now return:
>
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
or something similar depending on which java release package you've downloaded...
Ça fonctionne!