Hi Community. Thank you for the work you are doing with OH 3, it’s a hobby for me at the moment while I figure out what I can do with it. Plenty of inspired posts to keep me going but for now I have a Java questions please.
TIA for reading and devoting mind-time to this.
Context
I’m using a relatively recent desktop computer, plenty of RAM and HDD space, running Ubuntu 20.04 LTS headless server with:
OpenHab 3.1
SubSonic
Nextcloud
Homebridge
Wordpress
Apache2
MariaDB
I have some mid-level skills in this space, so am able to understand complex concepts but my search skills are frustrating me, so I thought I would ask to see if anyone else has the experience to help me a little faster than me trying to help myself.
The Ask
May I ask if it’s possible to start up OH 3.1 in a separate Java environment. I have Zulu 8, 11 and openJDK 8 and 11 on the dekstop. Default is current Zulu 8 because Subsonic is used heavily by the family and is incompatible with 11. Funny thing, OH3.1 is incompatible with 8.
So, easiest thing I could think of was use 8 and see if I can run OH3.1 by specifying a different Java environment specifically for it.
I came across this post: How to point OH2 to a different java version and while that is specific to rPI installs, does anyone have experience with OH3 in Ubuntu to start in a different Java environment to the default as chosen through ’ sudo update-alternatives --config java ’ (which will break my SubSonic install).
Yes, yes I know the obvious answer may be “jeez just use a few Raspbery Pi’s and all the problems will go away” but I really just want one Platform
Not really Java 8 & 11 are both LTS versions but Java 8 is nearing its end of support for patches, etc. OH3 will NOT run in Java 8. Perhaps you could use a container system such as Docker to run OH in a container. I have successfully run OH 2 & 3 in containers on the same system.
That’s fair enough - Docker is a little foreign to me so far. I’m used to being able to have full control over (for example) the ports I run things on. This desktop being a ‘jack of all trades’ I’m trying to keep it under as much control as I can.
However, not to fear - the solution for me was to edit the configuration file for OH and specify the java home directory - works like a charm now
All other error messages that i found in relation to Equinox container are related to using the wrong Java version.
According to my limited understanding it is essential to have JAVA_HOME set to the correct value.
As you mentioned you need to use JAVA_HOME set to an other version. I would assume that this is the problem.
Can’t you set JAVA_HOME for just that one user in the users environment settings overruling the system wide set JAVA_HOME envorinment variable ? For a test you may set that environment variable just before starting up OH from within a cmd box.