I am on the verge of releasing a project but it seem JAVA_HOME is been inconsistent. Maybe it\'s been overridden somewhere else? I am using ubuntu 14.04 and I have openjdk-7, ja
JAVA_HOME must point to jre, not jdk. Then set :
export JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre
Another workaround:
export JAVACMD=$JAVA_HOME/bin/java
setting /usr/lib/jvm/java ⇒ /usr/java/jdk1.7.0_45 did not work for me
I spend quite some time to tackle similar error. It looks like package manager might create mess in Java installations. Path to Java is sometimes hardcoded in bash files. I found one in /etc/profile.d/jdk.sh
. It just overrides your settings. Another fix/workaround for that is to update symlink, in my case it was /usr/lib/jvm/java ⇒ /usr/java/jdk1.7.0_45
. Try to look for java/bin
text in all bash files.
I had the same problem. My workaround was:
cd /usr/lib/jvm/java-8-oracle/jre/bin
sudo ln -s /usr/lib/jvm/java-8-oracle/bin/java java
I used OpenJDK as default java , updated JAVA_HOME in /etc/environment and all the issues went. Thanks for all your effort helping me through this
Creating a file .mavenrc
on my home folder and adding the code below solved the problem for me. (Ubuntu 14.10, Maven 3.2.1)
export JAVA_HOME=/usr/lib/jvm/java-8-oracle