Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

On a freshly installed box, Java was not installed, so I installed openjdk-6 via apt-get install openjdk-6-jre openjdk-6-jdk. When I try to start my Hadoop service, it complains that JAVA_HOME is not set.

Is there something that needs to be done to get JAVA_HOME set for all users?

share|improve this question
up vote 3 down vote accepted

Installing the packages typically sets up symlinks to the common Java binaries as /usr/bin/java, etc. and that's sufficient for most Java applications.

Some still want the legacy JAVA_HOME and for something like Hadoop, the best place to set it is in the global environment config file /etc/environment ; it will then be available in the console (TTY), terminals and the desktop.

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.