Sunday, January 06, 2008

java/linux: Setup ClassPath in Unix/Linux (ubuntu) on your .bashrc

If you want to be able to call eclipse / ant / java from any prompt in your linux system, then
edit your .bashrc and add this lines :

# User specific environment and startup programs
export ECLIPSE_HOME=/usr/local/eclipse
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export ANT_HOME=/usr/share/ant

PATH=$PATH:$ECLIPSE_HOME:$JAVA_HOME/bin:$ANT_HOME/bin

export PATH


note: $PATH is how your current path is configured. If you type in echo $PATH in the command line, you should see something like this
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:

The colon ":" is simply just the delimiter.

Once you've edited your .bashrc, reboot your pc (or type ctrl + alt + backspace) for your new settings to take effect. After you've rebooted, type the following from the command line and see the results :

echo $JAVA_HOME


See :

http://java.sun.com/docs/books/tutorial/essential/environment/paths.html

No comments: