I can't set up JAVA_HOME
. Before you dismiss this as a noob's question who can't figure out how to Google things let me explain my situation.
I bought RaspberryPi and installed Raspbian onto an SD card following tutorial steps. Everything seemed normal until I started tinkering with it and installing some stuff like maven
, tomcat
, logstash
or solr
.
Every tool complained about not finding java
in JAVA_HOME
. No biggie. I found which java
, followed some symbolic links to find java in /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java
. Java came with my Raspbian I did not install it. So I added:
export JAVA_HOME="/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt"
export PATH=$PATH:$JAVA_HOME/bin
at the end of ~/.bashrc
I'm no sysadmin but I did that a couple of times so no worries.
I was wrong. Regardless of where I put those lines (/etc/environment, ~/.bashrc, ~/.profile
) JAVA_HOME
doesn't seem to be set up. When I echo $JAVA_HOME
lo and behold there it is, pointing as supposed to.
When I type mvn -v
it returns:
Error: JAVA_HOME is not defined correctly.
We cannot execute /usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt/bin/java
So I checked permissions:
pi@raspberrypi:~ $ ls -laR /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java
-rwxr-xr-x 1 root root 3384 Dec 9 2015 /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java
But everyone has +x
I tried rebooting, using source
, nothing works. I'm out of ideas. Please help me Raspberry aficionados.