Set CLASSPATH for Java Development Kit (JDK) in Linux
The situation: Installing JDK in linux is not as easy as in Windows. After installing the downloaded binary (.BIN) JDK installer, I was thinking of this - if it is even in Windows XP that I have to configure the classpath manually (which is tad easy)...the how am I gonna do it in linux? So that I can use the terminal to type in java command (javac, jar etc) to perform operations on java virtual machine.
The Problem: How do I setup the CLASSPATH for JDK in Linux, so that I can use it on terminal every time I boot my Linux?
The Solution: In order to accomplish this, simple edit the file /etc/profile, and add the following to any of empty lines in the file:
PATH="$PATH:/opt/jdk1.5.0_07/bin:."
export PATH
...where the /opt/jdk1.5.0_07/bin is substituted with the actual directory of where the JDK is installed in your box. Save the file, and restart your machine.



0 Comments:
Post a Comment
<< Home