Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

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

tku@buster:~$ cat /etc/environment 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
[...]
LC_MEASUREMENT="de_DE.UTF-8"
JAVA_HOME=/home/tku/work/jdk1.7.0_05
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

 
discard

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.