April 11, 2008...6:57 pm

Setting Java (Sun JDK) Class Paths

Jump to Comments

After you’ve downloaded and installed the latest JDK form the Sun servers, you need to set up the class paths so that you can run java and javac from the terminal (Sun’s JAVA instead GNU GCJ). Here is the steps to set the classpaths

  1. Move the extracted files to /usr/java (if not exist, create a new directory)
  2. open a terminal and type vim .bashrc
  3. Insert the following lines

export PATH=/usr/java/jdk1.6.0_03/bin:$PATH
export JAVA_HOME=”/usr/java/jdk1.6.0_03″
export CLASSPATH=.:/usr/java/jdk1.6.0_03

Save & Exit, then Reboot the system. That’s all

Note: Set your path accordingly. ie if your JDK is 1.5 then the path will be like /usr/java/jdk1.5

1 Comment


Leave a Reply