What is the dependency that causes OH3 to be stuck on Java 11 (and not compatible with later versions at runtime) ?
Why do you think it isnāt compatible with later versions ?
Isnāt it rather the other way round, code that uses a feature that was introduced in say Java 14 will not run on Java 11 or 8.
In my try last week I experienced the same.
maven is refusing to compile if you donāt exactly use version 11.
I had installed latest (v15 believe) and it did not work.
Downloading v11 it indeed worked. Maybe something needs to be set to allow higher versions of some parameters voodoo to convince maven to proceed
Like many projects openHAB focusses on supporting Java LTS releases.
The latest LTS release is Java 11. The next LTS will be Java 17.
Thereās typically only 6 months of support on the non-LTS releases.
Oh - because when I downloaded the OH3 snapshot, it refused to work with Java 13. I had to source a new JDK11 in order to make it work at all (IIRC I also tried it with 12)
$> ./start.sh
Launching the openHAB runtime...
Could not create a builder for the system bundle.
$> java --version
java 13.0.1 2019-10-15
Java(TM) SE Runtime Environment (build 13.0.1+9)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
This seemed odd to me, there seemed to be a strong direction to āonly use JDK11ā hence my questionā¦
Thatās probably because Apache Karaf only supports Java 8-11, see:
OpenJDK no longer supports Java 13 since March 2020.
Except: https://issues.apache.org/jira/browse/KARAF-6624, wherein failure to start on JDK13/14 is treated as a bug, and has now been resolved.
So it looks like itās a dependency that needs updating and it may then work after that?
Why are you so keen to use Java 13+ ?
Java 9 and 10 had never been supported too ā¦
The reason java 9 and up was not supported has more to do with the breaking changes that were made in Java 9. Which required significant changes and is the reason people get stuck at java 8 in general. Thats a reason we only now move to a newer version of java. There is no such reason now, so its reasonable to expect newer versions would just work.
Because,
a) In common with many people, I didnāt actually have JDK11, only 13, because for work projects weāre using the additional features. This will end up much more common now java has woken up to a faster release cadence, itās an ache to have to remember āoh this project is special and isnāt forwards compatibleā, and
b) A lack of forwards-compatibility is a bad code smell IME. Java9,10,11 was /mostly/ OK with older projects provided you passed parameters to override some defaults. But Iām old enough to have the scar tissue from ancient Java 1.3 projects where āitāll get upgraded before Java vNext comes outā turns out to be āweāre now on Java vNext+++++ and it still ties us to an old JVMā.
I thought it might be a possibility that the reason was something to do with a hard collision between OSGi/Karaf and Jigsaw, and Iām not up to date on that stuff.
So I guess, from a personal perspective, Iām fine with āthis project defines a baseline of Java 11 for the codeā, thatās fine by me, I can see why thatās a reasonable call. If itās āit doesnāt work with any future version of Java, and this isnāt regarded as a bugā, then Iām likely to slowly start moving towards the exit from an āis this project worth spending time withā PoVā¦
They first need to release those Karaf versions before there is anything to upgrade to.
Since openHAB has many dependencies, youāll probably run into another incompatibility after that.
One more information: it seems that Karaf does not run with every Java 11 variant.
I tested it on Windows 10 with openJ9 version 11 and got lots of Karaf error messages.
But with Azul JDK 11 it works fine.
BTW: it is no proble to use a specific JDK only vor openHAB. You only have to set the environment variable JAVA_HOME to a supported JDK and then start openHAB.
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.