Closed banholzer closed 5 years ago
Hi @banholzer,
Unfortunately, we can't add Java as a dependency because many people opt to install it as manually, a Debian dependancy will block the install of openHAB until a package is installed. At one point, the openHAB package recommended Java but was undone by https://github.com/openhab/openhab-linuxpkg/pull/75, after this the Debian package only recommends.
We found that even with "recommends", apt would install a Java automatically for people even if they had a manually installed version. https://community.openhab.org/t/systeminfo-initialization-error-on-pine64/11726/25?u=benjy. This link was weakened to "suggests" instead.
Do you agree with this reasoning? If not, is there a suitable compromise?
Slightly off-topic: The post- or pre-install script could check for an existing java runtime and take action or at least notify the end-user
@BClark09 I dont think many peolple want to manually install Java on a Debian system. I think everyone would accept installing openjdk-9-jre-headless or another openjdk as long as it works - I think nobody chooses Oracle-Java as long he/she isn't forced to by the application. And nobody installs Java manually if there is a package which automatically upgrades on security issues.
The suggestion of @ThomDietrich would be a workaround - but usually a Debian package holds all needed dependencys and is running without further action.
@banholzer Sorry but no quite the opposite is true. The most common openHAB install is not on plain debian but on openHABian and/or Raspis, and that's where the recommended Java to use is Zulu which in fact has to be installed manually. openHABian will automate that but Java is not available as .deb packages.
@mstormi I'm sorry, but I can't agree with you. Zulu Java is also available as Debian package (https://www.azul.com/downloads/zulu/zulu-linux/) and it has set the "Provides" attribute to "Provides: java8-jdk, java7-jdk, java7-sdk, java6-sdk, java5-sdk, java2-sdk, java-sdk, java-compiler, java8-runtime, java7-runtime, java6-runtime, java5-runtime, java2-runtime, java-runtime"
so any dependency can be resolved by installing the zulu java package first if you want. Even if you like to use an Oracle Java you could build your own package in seconds with java-package (https://packages.ubuntu.com/xenial/misc/java-package) Dependency to e.g. "java-runtime" would be apropriate.
so the dependency should be in the openhab package to provide an "as expected" behaviour.
No it isn't. Those packages you refer to are for x86 only, and that's my point: while you're apparently only interested in installing the x86 version (probably because you use that HW), the majority of openHABian users uses ARM hardware. So since we're talking openHABian in general here (and not on x86 only) and need to decide on one or the other installation method, we should decide in favor of the majority. If you dislike that you're free to submit a PR to provide a package implementation for x86 users.
To add there isn't an official and up-to-date package repository for zulu-embedded-8, and this must be installed with a zip file.
Nonetheless, I agree that a user must be made aware that there is no suitable version of Java installed when installing openHAB (as it is fairly useless without it). I will look to add the same JAVA finding mechanism postinst to inform the user that there is action needed here.
@BClark09 this might be of interest: http://zulu.org/forum/thread/please-make-zulu-debian-packages-provide-java-runtime-headless
Debian packages are missing a required dependency on java. Following installation steps on a blank debian minimal works but daemon is unable to start because java is missing.
I think a "Depends: java8-runtime-headless" should be added.