-
-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for running openHAB with Java 11 #768
Comments
Today Java 11 got released! 🎁 😀 Azul still offers early access (EA) downloads. They do have a nice Java 11 blog. |
Debian Buster contains a armhf package of openJDK 11, so will use that to help test on the RPi if you need! :)
|
All Java 11 testing is appreciated. :-) Do you know if they compile OpenJDK 11 with hardware floating point operations instead of software floating point operations? AFAIK that usually is the main performance issue with OpenJDK 8 on Raspbian. |
I don't know unfortunately. I'm assuming that since the difference between:
and
means that OpenJDK-11 isn't set up for hardware float by default? Can this be changed simply by setting this property? |
On Windows the nrjavaserial library crashes the whole runtime when used with Java 11. See also NeuronRobotics/nrjavaserial#131 and this hs_err_pid3924.log. |
Looks like getting Jython running has a difference in behaviour on JDK11 too: |
Nowadays the Java 11 Zulu JVMs can be downloaded for most platforms:
|
@wborn Regarding
I have a patched version (per NeuronRobotics/nrjavaserial#131) of nrjavaserial-3.14.0.jar which has resolve the issue for me. Should I submit a PR somewhere? All of my prior work has been on the addons so I'm not sure which OH git project the core jars are in. On my OH runtime, the library is under runtime/system/com/neuronrobotics/nrjavaserial/3.14.0/nrjavaserial-3.14.0.jar |
I'd prefer all PRs for adding Java 11 support to go to the upstream repository (NeuronRobotics/nrjavaserial). If you read the issue (NeuronRobotics/nrjavaserial#131) they have the java11 branch for this. |
Unfortunately it looks that there is not much progress over there. |
That's what's also being said about openHAB. ;-) |
Found an issue with Eclipse IDE and Java 11. I am running Java 11 on my production system (linux) without issue. UIs work fine. In my development environment on Windows/Eclipse, PaperUI works in Java 9 and 10, but not in Java 11 or 12. When running with Java 11 or 12, I get a 404 error on http://localhost:8080/start/index If change the runtime JRE in openHAB_Runtime back to 9 and restart, PaperUI is fully functional again. Again, this seems specific to Eclipse and/or Windows as my prod setup with JRE 11 on linux works fine. Anyone else see this issue? EDIT:
Full log: |
Unfortunately I'm on my way to replace the entire dependency with the current OSGi approach that doesn't even need a specific library, just the reference implementation. See openhab-core for more information and stay tuned. |
According to your logging it also fails to allocate a port @dbadia which may also be causing issues :
It looks we might run into SSE issues with the old Jersey version, see also eclipse-ee4j/jersey#3965 (comment). It's easier to stay tuned if you add links (openhab/openhab-core#739) @davidgraeff . 😉 |
I am using the latest buster rpi noobs image and installed a 2.5 snapshot. WARNING: package org.apache.karaf.specs.locator not in java.base openjdk version "11.0.3" 2019-04-16 |
Updates the path used with the patch-module options to fix the following warning on Java 9+: WARNING: package org.apache.karaf.specs.locator not in java.base Error starting karaf activator org.apache.karaf.specs.activator.Activator: org/apache/karaf/specs/locator/OsgiLocator Adds a few more "add-opens" to the Karaf scripts so we can suppress the warnings on Java 9+ caused by XStream's reflection usage. Because XStream still works without any issues on Java 11 there is no need for users to see these warnings: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/openhab/userdata/cache/org.eclipse.osgi/66/0/bundleFile) to field java.lang.reflect.Proxy.h WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Related to openhab#768 Signed-off-by: Wouter Born <[email protected]>
It seems Gson is also causing warnings due to reflection when opening a sitemap in Basic UI:
|
Updates the path used with the patch-module options to fix the following warning on Java 9+: WARNING: package org.apache.karaf.specs.locator not in java.base Error starting karaf activator org.apache.karaf.specs.activator.Activator: org/apache/karaf/specs/locator/OsgiLocator Adds a few more "add-opens" to the Karaf scripts so we can suppress the warnings on Java 9+ caused by XStream's reflection usage. Because XStream still works without any issues on Java 11 there is no need for users to see these warnings: WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/openhab/userdata/cache/org.eclipse.osgi/66/0/bundleFile) to field java.lang.reflect.Proxy.h WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Related to #768 Signed-off-by: Wouter Born <[email protected]>
Suppresses the following warnings when using Basic UI on Java 9+ WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.gson.internal.bind.ReflectiveTypeAdapterFactory (file:/openhab/userdata/cache/org.eclipse.osgi/20/0/bundleFile) to field java.io.ByteArrayOutputStream.buf WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.bind.ReflectiveTypeAdapterFactory WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Related to openhab#768 Signed-off-by: Wouter Born <[email protected]>
Suppresses the following warnings when using Basic UI on Java 9+ WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.gson.internal.bind.ReflectiveTypeAdapterFactory (file:/openhab/userdata/cache/org.eclipse.osgi/20/0/bundleFile) to field java.io.ByteArrayOutputStream.buf WARNING: Please consider reporting this to the maintainers of com.google.gson.internal.bind.ReflectiveTypeAdapterFactory WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release Related to #768 Signed-off-by: Wouter Born <[email protected]>
It seems that older MaryTTS versions do work with GA Java 11 releases. In GA releases the |
I think this can be closed now - 3.0 is on Java 11 🎉. |
Still shows up as "Pinned issues" on the openhab-distro repository, might want to remove that as well now if not kept on purpose there. |
Thanks for noticing, good point! |
I'd like some clarification, please. So, 3.0 runs with Java 11. That's good news. But according to the "Installation Overview" openhab2 needs Java 8. I'd like to upgrade my server to Debian Buster which only comes with Java 11. I can, if need be, install openjdk-8-jre from oldstable (Stretch) but I like to avoid mixing OS versions on my servers. Is there an intention/plan to make openhab2 run with Java 11? |
Instead of mixing OS versions you can also install the Zulu Java 8 JVM. We do the same with the Debian Buster based openHABian and Docker containers. There was already a lot of work done to make OH 2.5 compatible with Java 11 so you can try it yourself to see how well it works. I've done some testing with it and the only major issues that I know of are incompatibilities with Jython and the whole JVM crashing on Windows when using add-ons that access serial devices. When there are add-on specific Java 11 issues it may be possible to fix these in 2.5.x. |
Which may be resolved in Jython 2.7.2b3 (I have not tested it with Java 11) |
It will NOT run under Java11 out-of-the-Box. The boot classpath method of adding jython is not working. |
Currently openHAB only supports Java 8 which is the most recent long-term support (LTS) release of Java.
We should also add support for running openHAB with Java 11, which is the next LTS release and will be released in a week (September 25th, 2018).
In #761 Karaf was upgraded to 4.2.1 which supports Java 8, 9, 10 and 11.
After testing openHAB with Karaf 4.2.1 on Java, 9, 10 and the JDK 11 Early-Access Builds the following issues have been found so far:
See: WARNING: An illegal reflective access operation has occurred x-stream/xstream#101, Test ESH with Java 9/10/11 eclipse-archived/smarthome#4369 (comment)
See: RRD4J will stop working with Java 9 rrd4j/rrd4j#72, [RRD4j] NoSuchMethodError when using Java 9/10/11 openhab1-addons#5663
See: java.version 9 is < 3 characters marytts/marytts#783, https://github.com/openhab/openhab2-addons/issues/3953
For compatibility of Eclipse SmartHome with Java 11 see also Test ESH with Java 9/10/11.
To simplify JDK 11 testing, I've created an openhab-docker branch that makes Travis create Debian and Alpine amd64 Docker images using Zulu Java 11 every day.
For the available tags see my wborn/openhab-jdk11 Docker Hub repository.
The text was updated successfully, but these errors were encountered: