-3

I am trying to compile mahout, I have temporarily changed the JAVA_HOME variable like this:

export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.33.x86_64/

and I checked that it was changed correctly using this command:

printenv |grep JAVA_HOME

which returns:

JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.33.x86_64

But when I run mahout mvn clean install -DskipTests=true I run into this error:

Error: JAVA_HOME is not defined correctly. We cannot execute /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.33.x86_64/bin/java

I am not sure how this bin/java has shown up. The questions that seem similar to mine with the trailing bin/java don't seem to be quite the same as mine or don't make sense because the answer is just to remove it but I never had it in my path in the first place.

How can I solve this bin/java issue? Thanks in advance.

Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125
hope288
  • 725
  • 12
  • 23

2 Answers2

0

You should append $JAVA_HOME/bin to the environment variable PATH:

export PATH=$PATH:$JAVA_HOME/bin
Haifeng Zhang
  • 30,077
  • 19
  • 81
  • 125
  • well it looks like the problem was export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.35.x86_64/ it's the difference between 33 and 35. It should be 35. Thanks anyways! – hope288 May 25 '15 at 19:51
0

Answering this in case others run into the same problem. If this post becomes old make sure you have the correct java file name version in the name!

export JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.35.x86_64/

I had the wrong name for the java path it should be:

java-1.6.0-openjdk-1.6.0.35.x86_64/ NOT java-1.6.0-openjdk-1.6.0.33.x86_64

35 NOT 33

hope288
  • 725
  • 12
  • 23