I switched to Zulu OpenJDK (1.8.0_222) on OpenHAB 2.5M3 (openhabian) a few days ago and everything is running well so far.
But: every time I run an update via openhabian-config, java seems to be removed, openhab stopped, a fresh install of Zulu OpenJDK and restart of openhab (see logfile attached).
How can I stop this behaviour and only restart openhab when a real upgrade is performed?
The issue is still there for me every time I run an Upgrade System through openhabian-config, constantly re-installing the same build 1.8.0_222-b178 over and over again.
Raspberry Pi 4, initially set up with openHABian 1.5 image.
$ apt-key add openhab-key.asc
OK
$ apt-get --yes upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ java_install_or_update
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)
$ systemctl stop openhab2.service
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf) (build 1.8.0_222-b178)
OpenJDK Client VM (Zulu8.40.0.178-CA-linux_aarch32hf) (build 25.222-b178, mixed mode, Evaluation)
2019-09-23_19:37:46_CEST [openHABian] Installing Java Zulu 32-Bit OpenJDK...
$ wget -nv -O /tmp/openhabian.Q5nlw/zulu8.tar.gz https://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf.tar.gz
2019-09-23 19:40:01 URL:https://cdn.azul.com/zulu-embedded/bin/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf.tar.gz [175560479/175560479] -> "/tmp/openhabian.Q5nlw/zulu8.tar.gz" [1]
$ update-alternatives --remove-all java
$ update-alternatives --remove-all javac
$ update-alternatives --install /usr/bin/java java /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/java 1083000
update-alternatives: using /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/java to provide /usr/bin/java (java) in auto mode
$ update-alternatives --install /usr/bin/javac javac /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/javac 1083000
update-alternatives: using /opt/jdk/zulu8.40.0.178-ca-jdk1.8.0_222-linux_aarch32hf/bin/javac to provide /usr/bin/javac (javac) in auto mode
$ wget -nv -O /tmp/openhabian.x6iU4/crypto.zip http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip
2019-09-23 19:41:23 URL:http://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip [12181/12181] -> "/tmp/openhabian.x6iU4/crypto.zip" [1]
$ unzip /tmp/openhabian.x6iU4/crypto.zip -d /tmp/openhabian.x6iU4
Archive: /tmp/openhabian.x6iU4/crypto.zip
creating: /tmp/openhabian.x6iU4/ZuluJCEPolicies/
inflating: /tmp/openhabian.x6iU4/ZuluJCEPolicies/LICENSE
inflating: /tmp/openhabian.x6iU4/ZuluJCEPolicies/README.txt
inflating: /tmp/openhabian.x6iU4/ZuluJCEPolicies/DISCLAIMER
inflating: /tmp/openhabian.x6iU4/ZuluJCEPolicies/local_policy.jar
inflating: /tmp/openhabian.x6iU4/ZuluJCEPolicies/US_export_policy.jar
OK
$ systemctl start openhab2.service
The only thing, which might be different to other users, is that In was bitten by the Java update error, which was briefly happening until it quickly got fixed - Openhabian config error on upgrade system
Other than not using Upgrade System through openhabian-config any longer, I’m at a loss as how to fix this issue.