Problem with java environment for karaf in minimal install on raspios

  • Platform information:
    • Hardware: Pi 2 Model B
    • OS:raspios 2020-05-27 4.19
    • Java Runtime Environment:zulu8
    • openHAB version:2.5.5-1

Starting with a fresh install of the latest Rasberry Pi raspios and using the basic GUI image. I installed the Zulu 8 jre into /usr/lib/jvm/zulu8.46.0.225-ca-jdk8.0.252-linux-aarch32hf. Added JAVA_HOME and PATH=$JAVA_HOME:$PATH to a drop in in /etc/profile.d. Verified that the jvm worked. I then installed added the openhab repos and installed openhab2.
The end of the the install gave warnings about not being able to find java. The installation process sets up an openhab user that does not have a shell. Therefore setting up pointers to java in /etc/profile does not have any effect.
This means that most users following the installation instructions would end up at a brick wall here.
What do I need to do for a quick fix to this installation? I presume this will mean some fixes to the karaf initialisation.
The longer term implications of this I would rather leave to someone else :slight_smile:

Roger

Follow the openHABian install instructions for any Linux distribution. It usually takes care of dependencies.

Yes why are you doing all of that? Get the openHABian image.
If you really want to ride the bleeding edge try the one from https://github.com/holgerfriedrich/openhabian/actions/runs/127721215, it’s based on that Raspi OS you used but beware it’s an untested dev version.
There’s also absolutely nothing wrong with using the standard one.

1 Like

I thought that was exactly what I had done.

I started here https://www.openhab.org/docs/installation/linux.html#meeting-the-requirements.

and followed the instructions. My Zulu install was from tar.gz not a deb file because there were no armhf deb files on the azul site. So that route could well have missed some essential config.

Using openHABian would have solved that for you.

Please do not take this personally. If an entity publishes a set of build instructions and someone follows them and hits a brick wall. Then I don’t think it is a good response to just say don’t follow the instructions do it a totally different way. I am happy to work with the community to ascertain whether I did not follow the instructions correctly. Or, the instructions are incorrect. Or the processes involved are flawed.

Before posting this I looked through posts here and found that “use openhabian image” is a very common response to problems found in the documented install process.

To the contrary, I think that’s about the right response as I’m assuming your interest is in getting your system to work and not in validating processes or docs. For sure it’s the faster route.
(for clarification: it isn’t us who wrote those docs).

Well you hadn’t even mentioned you were following instructions let alone which ones so how are we supposed to comment on that other than the way we did ?
And you’re using a brand new OS. I think it’s obvious that all official instructions were written earlier and not with that in mind so you should have at least expected things might go wrong.
And frankly, your post is written pretty unclear at least to me … even after reading it again, I have not understood what was the step the went wrong. You neither named the command nor showed the output.

Because it’s so much simpler and less prone to error hence the better alternative.

The link you gave is about manual install of openHAB. Bruce asked you to follow openHABian instructions. That’s something pretty different.

1 Like

Why did you not say that in your original post???

OK reading back through this. My comment was unwise and uncalled for. I apologise. I should have supplied more background.
I am trying to build a minimal configuration of which openhab is just a part.

To ask things in a different way. Is there a way I can provide the karaf container with the location of the java vm and runtime?

I am very sorry for the offence I have caused.

For future reference, the answer is.

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/zulu8.46.0.225-ca-jdk8.0.252-linux_aarch32hf/bin/java 1111

Again, why don’t you use openHABian. It uses the same OS base, only installs what’s needed for OH and does not remove anything what might be needed later when you want to install other stuff so you should be able to install whatever you wnat on top.
So I think it does what you’re after ?

I have come to my senses and switched to the openhabian config tool. My previous experience with openhabian was solely as a sd card image. I had not realised that there was a standalone openhabian config tool now.

Sorry for wasting peoples tIme. I anyone else reads this and is working in a debian related environment. “Use the openhabian config tool, Luke.” In particular avoid the zip archive method of installing Zulu.

1 Like

You can also run that with “unattended” argument, that’ll auto-install everything exactly like it does on top of the image.