Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Just launched an instance of EC2 and I tried doing:

$JAVA_HOME/bin/java -version

it gives me back:

 $JAVA_HOME/bin/java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.1) (amazon-
OpenJDK Client VM (build 19.0-b06, mixed mode)

so I can see that it is installed there. I opened up my bash profile however I don't see what my JAVA_HOME path is? How do I get this? THanks

share|improve this question
up vote 2 down vote accepted



env | grep JAVA

share|improve this answer

Your java path is displayed from /etc/profile.d/

If you want to install your own jdk use the following documentation:

share|improve this answer

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.