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

I work as java/j2ee application developer so kindly tell me how to set JAVA_HOME, JRE_HOME, CLASSPATH so that I may use Tomcat, Mysql ,java all together in Terminal.

I may be using all together in a pure CLI server environment, or in a GUI desktop environment.

share|improve this question

Using 12.04, placing the information in /etc/environment worked for me:

tku@buster:~$ cat /etc/environment 
share|improve this answer

If you have multiple versions of Java (or, for that matter, multiple versions of anything) installed, and want to be able to switch between them, Environment Modules is worth considering. It enables you to load, unload, and switch between the environment setups for different installed versions of any software that it's configured to handle. It's a de facto standard on clusters and, although it's a bit of a pain to set up at first, it's well worth the effort, IMHO.

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.