0

I am downloading some apache components, and in the official documentation they wrote:

Make sure that JAVA_HOME is set to the location of your JDK

I do have java installed and my eclipse is working good, but how can I know if this java_home variable is in the path?

Marco Dinatsoli
  • 10,322
  • 37
  • 139
  • 253
  • `echo $JAVA_HOME` ? `which java` ? Check the shell initialization files directly? – Mena May 26 '15 at 08:34
  • @Mena for echo $JAVA_HOME i didnt get anything in the terminal, when i did which java, i got `/usr/bin/java` what does that mean please ? I already went to java website and i checked which java do i have and i got that i have the latest recommended java version installed – Marco Dinatsoli May 26 '15 at 08:38
  • `/usr/bin/java` is likely a simlink. Find out where it leads to (in Mac OS this can be quite nested down). When you know where exactly the JDK you installed is located, set the `JAVA_HOME` value to the JDK folder in your shell initialization files (e.g. for bash, `.bashrc`). – Mena May 26 '15 at 08:41
  • I wrote "javac -version" and I got `javac 1.8.0_45` which means the jdk is installed on my mac. but how can i know the location of the jdk please – Marco Dinatsoli May 26 '15 at 08:51
  • @Mena i just put this questoin http://stackoverflow.com/questions/30454505/mac-os-how-to-set-java-home-correctly-in-the-path could you check please? – Marco Dinatsoli May 26 '15 at 09:23

1 Answers1

0

Open the terminal on your mac (easiest way to open terminal, type terminal in spotlight search). Run "printenv" command on terminal. It will show all the environment variables set on your mac. You can find out there if JAVA_HOME is set.

Milan Pandey
  • 1,010
  • 10
  • 22