Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I type which java in a terminal, I get


and on typing echo $JAVA_HOME, I get


If I try java -version or /usr/bin/java --version or java -V, however, it's freezing up.

On typing type java, it gives me:

java is hashed (/usr/local/tools/i386_Darwin/jdk1.7.0_21/bin/java)

I'm not sure if I'm supposed to set up an environment variable or should I reinstall jdk?

share|improve this question

migrated from stackoverflow.com Jun 17 '13 at 19:30

This question came from our site for professional and enthusiast programmers.

Off topic ... maybe this should be on serverfault.com –  Tim Bender Jun 17 '13 at 18:40
add comment

1 Answer 1

I don't know if there is a PATH variable edited with the location you installed java to on your system.

It may not be on your PATH variable. This is the list of directories the OS looks for executables in.

You can see this environment variable with

echo $PATH

If it is not on PATH variable then edit this variable and try again.

share|improve this answer
Thanks. I restarted my computer and reinstalled jdk 1.7. Seems to be working now! –  Siddhartha Jun 17 '13 at 19:17
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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