[Resolved] Unable to start openhab-2

I want to play with openhab-2.

Installed on a Windows 7, x64, installed JDK 1.8 (and command prompt confirms java 1.8 with “java -version”)
Using latest snapshot of openhab-2.0.0

when starting in debug mode, I get the following error:
Launching the openHAB runtime…
Unrecognized VM option '+UseG1GC’
Could not create the Java virtual machine.

any pointers on what is going on ?

Thank you,

J-F

Is this OracleJDK or OpenJDK?

Oracle JDK

does openJDK exists for windows ?

@davy Any idea? Is the G1 missing on other JVMs than the ARM one as well…? I couldn’t find anything about that.

According to this page, the option is supported by Oracle JDK 1.8.
Can you execute the command below and post the result?

java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version

Does this mean it starts correctly when not using debug mode?

@davy Here’s the output (to big to paste here) :

http://pastebin.com/6NzxxmEt

@davy no, I get the same results if I only run the start.bat

That output contains

     bool UseG1GC                                   = false                               {product}

which means it knows the option. Just to make sure, can you try the following command (and post the output):

java -XX:+UseG1GC -version

Here is the output :

C:\openhab-2>java -XX:+UseG1GC -version
java version "1.8.0_73"
Java™ SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot™ 64-Bit Server VM (build 25.73-b02, mixed mode)

OK, so the JVM appears to be correct and it does accept the option.
I’m wondering if openHAB is starting using a different JVM.
Can you try adding the same command in the start.bat and then start openHAB.
You should see exactly the same output appear…

I pasted the command before the @echo off so we can see the commande being executed.

C:\openhab-2>start.bat

C:\openhab-2>java -XX:+UseG1GC -version
java version "1.8.0_73"
Java™ SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot™ 64-Bit Server VM (build 25.73-b02, mixed mode)
Launching the openHAB runtime…
Unrecognized VM option '+UseG1GC’
Could not create the Java virtual machine.

ok, I found my problem…

While looking in the karaf.bat file, there’s a setting looking for a JAVA_HOME env. variable… I had one set to a old JDK 1.5… (for another project). I changed it and openhab started like a charms.

Thanks for the lead on finding my problem :smile:

J-F.

Can you try the command

echo %JAVA_HOME%

It looks like karaf may be switching to another jvm…

Great! problem solved. Have fun with openHAB.

On a side note, should’t there be a check, if a JAVA_HOME is set, look and see if the java bin in there is also to a latest version capable of running openhab ? - just a tought

We specifically had introduced such checks, see here and here.
@davy Are we checking the version against the java on the path and not the one defined in JAVA_HOME?

The check is indeed on the java on the path…