Installation - OH2 doesn't start after reboot

I’m trying to install OH, on a fresh Raspbian install, using apt-get. It all works fine until I reboot.
Then OH2 doesn’t start anymore. It stops with the following error:

Launching the openHAB runtime…
./runtime/bin/karaf: line 42: .: /usr/share/openhab2/runtime/bin/setenv: cannot execute binary file
karaf: JAVA_HOME not set; results may vary
Listening for transport dt_socket at address: 5005
WARN: file:/usr/share/openhab2/runtime/etc/ is not found, so not loaded
WARN: file:/usr/share/openhab2/runtime/etc/ is not found, so not loaded
Error occurred shutting down framework: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(
at java.lang.Integer.parseInt(
at org.apache.karaf.main.ConfigProperties.(
at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(
at org.apache.karaf.main.Main.main(

Any idea what could be the reason?
Im using a RaspberryPi 3.

Make sure you did all required steps:

If everything went well, you can start openHAB and register it to be automatically executed at system startup.

Linux init systems based on sysVinit (e.g. Debian 7, Ubuntu 14.x, Raspbian Wheezy and earlier):
sudo /etc/init.d/openhab2 start
sudo /etc/init.d/openhab2 status
sudo update-rc.d openhab2 defaults
Linux init systems based on systemd (e.g. Debian 8, Ubuntu 15.x, Raspbian Jessie and newer):
sudo systemctl start openhab2.service
sudo systemctl status openhab2.service
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service

I did all those steps, including Java upgrade. Several times!
I also tried openhabian.

Now trying with another card…