Im losing my hair. lol

Ok. I downloaded the Ubuntu base image from Pine64 and flashed to my SD Card, did all update and upgrades.
Then I followed these instructions to install a 32 bit version of java. https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps
Just changed things up so I had the most recent version.

wget --header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u111-b14/jdk-8u111-linux-arm32-vfp-hflt.tar.gz

tar -zxf jdk-8u111-linux-arm32-vfp-hflt.tar.gz -C /opt/jdk

update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_111/bin/java 100

update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_111/bin/javac 100

Everything goes well until I check the java version with java -version then I get.
ubuntu@localhost:~$ java -version
-bash: /usr/bin/java: No such file or directory

Not sure what I did wrong. I have not even tried to install openhab2 yet.

If you logout and log back in, is java still not found on your path?

I have tried login out and even did a reboot. Still not there.

Something like this might make a difference:

Put this at the end of your /etc/profile

export JAVA_HOME="/path/to/java/jdk"
export PATH=$PATH:$JAVA_HOME/bin

Do I put in the path to where the java is after JAVA_HOME=

JAVA_HOME should be set to the directory that contains bin/java (that is, that contains the bin directory, in which the java program is located). You might find it by

sudo find / -name java -print

Sorry for being such a newbie. But learning minute by minute.
Here is what I see:
ubuntu@localhost:~$ sudo find / -name java -print
[sudo] password for ubuntu:
/var/lib/dpkg/alternatives/java
/opt/jdk/jdk1.8.0_111/bin/java
/opt/jdk/jdk1.8.0_111/jre/bin/java
/etc/alternatives/java
/usr/bin/java
ubuntu@localhost:~$

That should be JAVA_HOME

Hmmm. Still not there.

These are the instructions I use: http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Will that work if I want to install the 32 bit version?

I don’t know. You can always download and follow the instructions from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html#A1097144

I had a similar problem. It is related to the 32-bit java binaries looking for 32-bit OS libraries.

Try these steps.

  1. enable 32-bit architecture
    dpkg --add-architecture armhf
  2. install required 32-bit libraries
    apt-get install libc6:armhf libncurses5:armhf libstdc++6:armhf

Feel free to join the Openhabian discussion. We are working to have the Pine64 supported.

The 32-bit java on pine issue is also reported here:

Your input would be appreciated.