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/config.properties is not found, so not loaded
null
WARN: file:/usr/share/openhab2/runtime/etc/config.properties is not found, so not loaded
Error occurred shutting down framework: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at org.apache.karaf.main.ConfigProperties.(ConfigProperties.java:208)
at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:226)
at org.apache.karaf.main.Main.main(Main.java:191)

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

Make sure you did all required steps:

http://docs.openhab.org/installation/linux.html#package-repository-installation

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…