Setting Java (Sun JDK) Class Paths

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

Advertisements

1 Comment

Filed under Configuration, Linux, Programming, Tips, Ubuntu

One response to “Setting Java (Sun JDK) Class Paths

  1. Thanx da machaaa.
    Its working……..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s