问题
I have installed JRE successfully:
However, Octave keeps showing that it can't find JRE.
回答1:
Following https://octave.1599824.n4.nabble.com/Octave-4-installer-doesn-t-detect-JRE-at-install-time-td4670684.html and: https://superuser.com/questions/1382158/on-windows-why-java-version-return-error-opening-registry-key-software-javas
- run regedit.exe as Admin
- change CurrentVersion in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\ to 12.0.2
- create: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2
- set JavaHome in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2\ to: C:\Program Files\Java\jdk-12.0.2
- open cmd and type: java -version
- in case of error type: where java
- cmd will return folder or few; in explorer go to the one ending with \javapath for example C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- there should be files: java.exe javaw.exe and javaws.exe
- if so delete them, reopen cmd and type java -version
Now it should display correct version without errors
- In Octave type javachk jvm
if ans is empty java should be working now
来源:https://stackoverflow.com/questions/58815879/octave-cant-find-jre-while-i-have-installed-jre