openHAB 2.5.6 wrapper service does not work with Java 11

  • Platform information:
    • Hardware: Intel NUC I7
    • OS: windows 10
    • Java Runtime Environment: JAVA_VERSION=“11.0.7” JDK11
    • openHAB version: 2.5.6
      Openhab does not start as a service.

log in userdata/bin/wrapper:
WARN | wrapper | 2020/07/05 06:25:24 | Unable to expand environment variable, PATH as it would be longer than the 16384 byte buffer size.

log in userdata/logs/wrapper:

STATUS | wrapper  | 2020/07/05 06:25:24 | --> Wrapper Started as Service
STATUS | wrapper  | 2020/07/05 06:25:25 | Launching a JVM...
INFO   | jvm 1    | 2020/07/05 06:25:25 | -Djava.endorsed.dirs=C:\Program Files\Java\jdk11\jre\lib\endorsed;C:\Program Files\Java\jdk11\lib\endorsed;C:\openHAB2\runtime\lib\endorsed is not supported. Endorsed standards and standalone APIs
INFO   | jvm 1    | 2020/07/05 06:25:25 | in modular form will be supported via the concept of upgradeable modules.
INFO   | jvm 1    | 2020/07/05 06:25:25 | Error: Could not create the Java Virtual Machine.
INFO   | jvm 1    | 2020/07/05 06:25:25 | Error: A fatal exception has occurred. Program will exit.
ERROR  | wrapper  | 2020/07/05 06:25:25 | JVM exited while loading the application.
STATUS | wrapper  | 2020/07/05 06:25:29 | Launching a JVM...
INFO   | jvm 2    | 2020/07/05 06:25:30 | -Djava.endorsed.dirs=C:\Program Files\Java\jdk11\jre\lib\endorsed;C:\Program Files\Java\jdk11\lib\endorsed;C:\openHAB2\runtime\lib\endorsed is not supported. Endorsed standards and standalone APIs
INFO   | jvm 2    | 2020/07/05 06:25:30 | in modular form will be supported via the concept of upgradeable modules.
INFO   | jvm 2    | 2020/07/05 06:25:30 | Error: Could not create the Java Virtual Machine.
INFO   | jvm 2    | 2020/07/05 06:25:30 | Error: A fatal exception has occurred. Program will exit.
ERROR  | wrapper  | 2020/07/05 06:25:30 | JVM exited while loading the application.
STATUS | wrapper  | 2020/07/05 06:25:34 | Launching a JVM...
INFO   | jvm 3    | 2020/07/05 06:25:34 | -Djava.endorsed.dirs=C:\Program Files\Java\jdk11\jre\lib\endorsed;C:\Program Files\Java\jdk11\lib\endorsed;C:\openHAB2\runtime\lib\endorsed is not supported. Endorsed standards and standalone APIs
INFO   | jvm 3    | 2020/07/05 06:25:34 | in modular form will be supported via the concept of upgradeable modules.
INFO   | jvm 3    | 2020/07/05 06:25:34 | Error: Could not create the Java Virtual Machine.
INFO   | jvm 3    | 2020/07/05 06:25:34 | Error: A fatal exception has occurred. Program will exit.
ERROR  | wrapper  | 2020/07/05 06:25:34 | JVM exited while loading the application.
STATUS | wrapper  | 2020/07/05 06:25:39 | Launching a JVM...
INFO   | jvm 4    | 2020/07/05 06:25:39 | -Djava.endorsed.dirs=C:\Program Files\Java\jdk11\jre\lib\endorsed;C:\Program Files\Java\jdk11\lib\endorsed;C:\openHAB2\runtime\lib\endorsed is not supported. Endorsed standards and standalone APIs
INFO   | jvm 4    | 2020/07/05 06:25:39 | in modular form will be supported via the concept of upgradeable modules.
INFO   | jvm 4    | 2020/07/05 06:25:39 | Error: Could not create the Java Virtual Machine.
INFO   | jvm 4    | 2020/07/05 06:25:39 | Error: A fatal exception has occurred. Program will exit.
ERROR  | wrapper  | 2020/07/05 06:25:39 | JVM exited while loading the application.
STATUS | wrapper  | 2020/07/05 06:25:44 | Launching a JVM...
INFO   | jvm 5    | 2020/07/05 06:25:44 | -Djava.endorsed.dirs=C:\Program Files\Java\jdk11\jre\lib\endorsed;C:\Program Files\Java\jdk11\lib\endorsed;C:\openHAB2\runtime\lib\endorsed is not supported. Endorsed standards and standalone APIs
INFO   | jvm 5    | 2020/07/05 06:25:44 | in modular form will be supported via the concept of upgradeable modules.
INFO   | jvm 5    | 2020/07/05 06:25:44 | Error: Could not create the Java Virtual Machine.
INFO   | jvm 5    | 2020/07/05 06:25:44 | Error: A fatal exception has occurred. Program will exit.
ERROR  | wrapper  | 2020/07/05 06:25:44 | JVM exited while loading the application.
FATAL  | wrapper  | 2020/07/05 06:25:44 | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.
FATAL  | wrapper  | 2020/07/05 06:25:44 |   There may be a configuration problem: please check the logs.
STATUS | wrapper  | 2020/07/05 06:25:44 | <-- Wrapper Stopped

I have same error when I try to start Openhab3 as a service in same Java enviroment.
If I comment out:
wrapper.java.additional.8=-Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed"
in openHAB2-wrapper.conf then service starts but Openhab will not work.
I think problem is wrapper config in Java 11 enviroment.

@kovacsi2899

Openhab 2.x.x does not run with Java 11. It is only running with Java 8.

If the wrapper service is running for OH3, which is designed for Java 11, I don’t know.

It runs with Java 11 sorry. If I start with start.but no problem. I use snapshoz what works with Java 11 without any problem. Also I use new rule engine with Jyhton.

Some things of OH2 do not work with Java 11. Looks like you have found one of them.

That is true, but it is the only one so far. As I see it is only a configuration problem just I do not have enough experience to fix it.

There were times, not long ago, that it was recommended to use Java 8 with OH2. But it seems to run also with Java 11, recently. See also here.

That was the ReQUIREMENT when 2.5 core was released. Some people have said parts work with Java 11 but, as far as I know, OH 2.5.x is not supported with Java 11.