Octave can't find JRE while I have installed J

2020-05-06 14:08发布

问题:

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

  1. run regedit.exe as Admin
  2. change CurrentVersion in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\ to 12.0.2
  3. create: HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2
  4. set JavaHome in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment\12.0.2\ to: C:\Program Files\Java\jdk-12.0.2
  5. open cmd and type: java -version
  6. in case of error type: where java
  7. 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
  8. there should be files: java.exe javaw.exe and javaws.exe
  9. if so delete them, reopen cmd and type java -version

Now it should display correct version without errors

  1. In Octave type javachk jvm

if ans is empty java should be working now



回答2:

Make sure you installed right architecture(x86 or x64) of jre, it fixed the issue for me.



标签: octave