Unable to start program. Java issue?

  • Platform information:
    • Hardware: i7-656U @2.20GHz
    • OS: Win 10 Pro 64bit
    • Java Runtime Environment: 8.151 64 bit
    • openHAB version: 2.2
  • Issue of the topic: Seriously wondering if I’m capable of using this software after not even being able to get it started.
    Followed instructions on install. Using command prompt, ran start.bat and got a response akin to “we’re running this on your standard java install but you should install a JDK” , BUT, openhab started. Of course, I did not continue to see what worked and what didn’t, I just took the suggestion of the response and downloaded JDK 9.1 from Oracle. Reset the JAVA_HOME variable to the appropriate folder and nothing worked. It was like I went backwards a few steps. Soooo, decided to reset everything and start again. Removed the JDK, reset JAVA_HOME variable to the basic java folder and now get "“Launching the openHAB runtime…
    WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available.
    Install Java Developer Kit to fix this.
    For more details see http://java.sun.com/products/hotspot/whitepaper.html#client
    The system cannot find the path specified.”

Not sure why it worked the first time right off the bat, but not now. What am I missing?
Thanks

I don’t run on Windows so can’t comment too much on why it is not starting for you, but I can say that it didn’t work with JDK 9.1 because OH doesn’t run on Java 9 yet. You need to stay on an 8 version of Java.

The error sounds to me like it can’t find your Java. You did set your JAVA_HOME but did you at a minimum restart your cmd or powershell window after changing the variable? Environment variable changes do not get picked up by running cmd and powershell windows. Furthermore, I recall on occasion needing to restart explorer.exe or logging out and back in to get changes to environment variables to be picked up properly sometimes. This was back in Windows 7 days so I don’t know if that would still be the case with Windows 10.

It probably worked the first time because JAVA_HOME was set up and pointing at a valid Java runtime the first time. After modifying it and changing it a couple of times, it probably is not pointing at a valid Java for that terminal or your current login.

Are you running start.bat from the root or are you incorrectly running it from runtime/bin?

Thanks Rich. I did actually end up backdating to JDK 8 with no change. I not only restarted the powershell window, I restarted the machine after each change. One time I even shut down the machine, and then started back up. I’m sure it’s just something stupid, I’ll give it another shot tonight.

Hi Brian. From the root, see attached.

First try cd openhab2 then run .\start.bat. And if that doesn’t work, just to check: What is the output of java -version?

Hi Ben. See attached. Thanks.

FIXED

A series of java issues. 1st, I downloaded and installed JDK9.1 which is not compatible with openhab2.

I then backdated Java to JDK8.1, but absentmindedly installed the 64bit version. My system is 64 bit, and I had read that I should install 32bit Java, but glazed over at install time.

Removed all Java versions, installed JDK8.1 and now Openhab is running.
Thanks for the support!

1 Like

I run 64bit Java just fine actually. Good to hear you’re up and running though.

Try to remove the JAVA_HOME variable in Windows and restart the server using the .bat file.
You’ll get al least two errors, but the server will start.

I’m using the following versions:

C:\Users\knx>ver
Microsoft Windows [Version 10.0.16299.1087]

C:\Users\knx>java -version
openjdk version “11.0.4” 2019-07-16 LTS
OpenJDK Runtime Environment 19.7-(Zulu-11.33+15-win_x64)-Microsoft-Azure-restricted (build 11.0.4+11-LTS)
OpenJDK 64-Bit Server VM 19.7-(Zulu-11.33+15-win_x64)-Microsoft-Azure-restricted (build 11.0.4+11-LTS, mixed mode)

C:\Users\knx\Downloads\openhab-2.4.0>start.bat
Launching the openHAB runtime…
ERROR: The system was unable to find the specified registry key or value.
ERROR: The system was unable to find the specified registry key or value.

                      __  _____    ____

____ ____ ___ ____ / / / / | / __ )
/ __ / __ / _ / __ / // / /| | / __ |
/ /
/ / // / __/ / / / __ / ___ |/ // /
_/ ./_// /// /// |/_____/
/_/ 2.4.0
Release Build

Heh. Thanks man. No way to try. I ditched it all a few weeks after posting. Obviously it’s way over my head. I went with something more user friendly, if not as well featured.