When I am running my maven build I am getting this error:

Error: JAVA_HOME is not defined correctly.
  We cannot execute /usr/bin/bin/java

I have edited .bashrc, .profile, /root/.profile and /root/.bashrc files with this:

export M3_HOME=/usr/bin
export PATH=$PATH:$M3_HOME

export JAVA_HOME=/usr/bin

How to fix this?


You probably want JAVA_HOME to be /usr (or whatever it's supposed to be, I'm not a Java user, but it's usually something like /usr/java/jdk1.7.0_05, i.e. pointing to a specific JDK subdirectory), and then PATH to include $JAVA_HOME/bin.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.