Just loaded OHAB2 and the runtime popped open and closed. Put a PAUSE in the karaf.bat file near the beginning.
JAVA_HOME is not valid
Apparently it’s not finding a path in the REG file. I searched the whole HKEY_LOCAL_MACHINE for JAVA_HOME and did not find it. OpenHAB 1 worked fine. My JAVA is 1.8.
Right Click “My Computer” / “Computer” / “This PC” (depending on which version of Windows you are running) and select “Properties”. From here where the environment variables are differs based on which version of Windows you have. If on Windows 10 press “Advanced System Settings” and there is a button called “Environment Variables”.
You will have to restart explorer.exe or reboot for the changes to be picked up.
VIOLA! I added the path to JDK in the system environment variable PATH, restarted explorer and away she went. I hope this will help others.
Thanks
*R
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
9
I’m having a similar issue in Linux Ubuntu 16, since I tried to swap the Java version.
OpenHab2 and everything associated with it was working, I just wanted to try to change it from Oracle 8 to Zulu 8.
which just didn’t work on this particular machine, so I swapped back to OpenJDK version 1.8.0_181
OpenHab2 now runs fine, but for some reason when I try to start the openhab-cli console
I get this error
JAVA_HOME is not valid: /usr/lib/jvm/java-8-oracle
Is there a file I need to tweak within OpenHab2 to set the correct JAVA_HOME variable?
java -version responds with ;
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK Server VM (build 25.181-b13, mixed mode)
With Oracle Java, assuming you installed using the webupd8team PPA, has an sudo apt-get install oracle-java8-set-default which will configure everything so Oracle Java is the default on your system. I don’t know what it all does but suspect it sets up symbolic links and modifies /etc/defaults files.
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
11
Umm
That’s that I thought might be happening, but I just can’t find a file that still points to Oracle.
FYI
I can’t find a file in /etc/defaults that looks like it might hold the answer…
I did the install yesterday and had problems with the Java. I received the message " 8 was unexpected at this time " . I edited all the the .bat files and deleted the first line “@echo off”, with this I started to see all the actions into the command line and I discovered that into the file runtime\bin\setenv.bat there was a line adding “/java/bin” to the end of the Java Path causing the trouble (use the locate ctrl+f to find it), so I deleted this “/java/bin” text and the instalation worked fine.