Home arrow The geek's log arrow Set CLASSPATH for Java Development Kit (JDK) in Linux
Set CLASSPATH for Java Development Kit (JDK) in Linux
Written by Mohd Izuardi Ibrahim   
Thursday, 28 September 2006

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.

 

Comments (0)Add Comment

Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley
Smiley

busy