[SOLVED] [Windows] Start openHAB for the first time

  • Platform information:
    • Hardware: Intel i7 RAM: 8GB, 64-bit
    • OS: Windows 10 Home
    • Java Runtime Environment: jdk1.8.0_201
    • openHAB version: 2.4.0
  • Issue of the topic: error when executing start.bat

Dear openHAB Community!
I’m very much new to openHAB and I installed openHAB for the first time today. The problem is whenever I want to start the start.bat it says the following:

Launching the openHAB runtime…
8 was unexpected at this time.

I don’t even know where to start searching the problem.
Any help would be appreciated!

try running the start.bat command from the command line instead of clicking on it so you can see the full message…I think you are missing more of the error message.

Also make sure you set the JAVA_HOME environmental parameter as per the install instructions.

Squid

yes I already set the Java_HOME, furthermore I installed the 32bit version. I already started it in the cmd, but I still get the same error.

I also set my system language to English, because before that I had following error:

WARNING: Running Karaf on a Java HotSpot Client VM because server-mode is not available.
Install Java Developer Kit to fix this.
command ““C:\Program Files (x86)\Java\jdk1.8.0_201\bin”” was not found (sorry if this is a wrong translation, because the error was in German)
Restarting JVM…
But as I already said I have installed the jdk…

Did you uninstall the HotSpot version and then reboot? Sometimes the Windows Path does not get cleared and updated until you reboot.

Squid

i edited the PATH variables again and now it’s working
thank you for your help and time!

There is a trick you can use to avoid a full reboot, though I don’t know if it still works in Windows 10.

  1. Open the task manager
  2. Find explorer.exe in the list and kill it
  3. File -> Run -> and type in explorer.exe. Hit enter and your start button will come back and it will have loaded all your new environment variables.

I can’t say if it works in Win 10 but it did work in Win 7.

I’ve had limited luck with that…sometimes the system does not come back all the way or certain processes don’t start back up in the proper order…it’s worth a shot.

This seems to be just a nuisance message by the way. I run oracle java 8 (not jdk) on Win 7, get this message every start, but no ill effects at all.

This comes from the fact that there are two different ways that Java optimizes the code as it runs. The first way, client mode, optimizes for a fast startup. But this means that over the long term it misses our can’t do some optimizations that could make the the program run faster. The second is server mode which sacrifices startup time in favor of long term optimizations that make the parts of the service run faster.

Obviously, a long running program like OH benefits from the service optimizations. But the JRE doesn’t provide that mode. So Karaf preview a warning and recommendation to use the JDK instead, which she’s have server mode.

You OH will still run just fine, it just won’t run as fast or as well as it might otherwise.

1 Like

Ah, unexpected consequence. As we’re talking Windows and probably on a box with more horsepower than a Pi - I shall not worry :slight_smile:

I had the same problem. To be more specific, I had set the JAVA_HOME variable to “C:\Program Files\Zulu\zulu-11\bin”, but the “\bin”-part is automatically appended and has to be removed.

So the correct JAVA_HOME is the plain install path of Java:
“C:\Program Files\Zulu\zulu-11”