3

am trying to set up apache hadoop in my system. In the procedure page it says "edit the file conf/hadoop-env.sh to define at least JAVA_HOME to be the root of your Java installation. "

What does setting "JAVA_HOME" and "root of java partition" actually mean. Does the root mean the place from where java gets loaded(ie, output of "which java" command)??

Am using Fedora 12

emiljho
  • 572
  • 1
  • 10
  • 18

3 Answers3

6

JAVA_HOME denotes the installation folder of a JRE or SDK. It contains binaries, libraries and documentation. You can find out the root installation directory by typing

$ which java

The part before the bin/java will typically be your JAVA_HOME.

miku
  • 181,842
  • 47
  • 306
  • 310
  • I did what you suggested, but when i run `pig -x local` it always outputs: Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java... Is there another version of java I should use to prevent this from showing up? – harryt Apr 14 '14 at 21:41
  • 1
    figured it out. i have a mac. http://stackoverflow.com/questions/11372166/making-sure-java-home-is-correctly-set – harryt Apr 15 '14 at 22:05
2

In my case (Debian) it is: /usr/lib/jvm/java-6-sun, file /usr/bin/java is a symlink to /etc/alternatives/java which is a symlink to /usr/lib/jvm/java-6-sun/jre/bin/java

wlk
  • 5,695
  • 6
  • 54
  • 72
1

The path /System/Library/Frameworks/JavaVM.framework/Versions/Some_version_number/Home/ is where mine is on Macbook pro (Lion).

Here is mine: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/

When you type 'which java' a symlink is what is returned, not the actual Java home path that you need. This path should be defined in the file conf/hadoop-env.sh which is in the root of the Hadoop package.

I'm using Hadoop and I ran into this problem. The path that I posted fixed my problem.