ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
A nice way to store all the java-settings is to add the file java.sh to /etc/profile.d
Place all the java-settings such as JAVA_HOME, J2EE_HOME, CATALINA_HOME and so on in this file and after making this file executable (chmod +x java.sh), all the settings will be available to all the users on this machine
in my bash profile, I've just added:
export CLASSPATH=$CLASSPATH:~/java (if .class files are in $HOME/java)
and
PATH=$PATH:/usr/java/j2sdk1.4.2_03/bin
to be able to run java and javac
Originally posted by pycoucou
why do you use extra variables??
Cheers,
Pierre-Yves
Because I use Tomcat to server jsp-pages (CATALINA_HOME) and because using JAVA_HOME and J2EE_HOME makes it easier to experiment with other/newer Java-versions
My java.sh contains:
export JAVA_HOME=/usr/local/j2sdk1.4.2_04
export CATALINA_HOME=/usr/local/jakarta-tomcat-5.0.25
export ANT_HOME=/usr/local/ant
PATH=$PATH:$JAVA_HOME/bin:$ANT_HOME/bin
To my knowledge, the JAVA_HOME variable is used by all kinds of Java-software that needs a Java runtime environment such as Open Office or the Eclipse development tool.
The first versions of Tomcat needed the CATALINA_HOME setting. I don't know if this setting is still mandatory but I still maintain it.
Ant is a make-utility
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.