Chat with us, powered by LiveChat
Installing JDK in Debian

Installing JDK in Debian

In order to run Tomcat, you will need to install JDK and set the JAVA_HOME environment variable to identify the location of the JDK environment on your system.

1. You can download JDK 5.0 at http://java.sun.com/j2se/1.5.0/download.jsp.

2. Click on Download JDK 5.0 Update 6 to go to the download page.

3. Click Accept to accept the license agreement.

4. Next choose the Linux self-extracting file. This is the download for the self-extracting binary file rather than the rpm.

5. Download to your preferred download directory. Change to that directory and make it executable by executing the following command

#chmod +x jdk-1_5_0_06-linux-i586.bin

Now execute the file:

#./jdk-1_5_0_06-linux-i586.bin

You should now have a new directory called jdk1.5.0_06. Now move this directory to the location where it should be run. We chose /usr/lib/.

#mv jdk1.5.0_06 /usr/lib

Now create a symbolic link called jdk to JAVA_HOME by the following command. This allows you to easily switch back and forth between different jvms should you ever need to.

#cd /usr/lib

#ln -s jdk1.5.0_06 jdk

Now we need to set the JAVA_HOME environment variable. Add the following at the end of /etc/profile just after export PATH.

JAVA_HOME=”/usr/lib/jdk”
export JAVA_HOME

/etc/profile is executed at startup and when a user logs into the system. In order to update the environment you will need to log out and log back in to the system.

Check to make sure JAVA_HOME is defined correctly by executing the command below. This should report the location of the Java SDK which should be /usr/lib/jdk.

echo $JAVA_HOME

Sharing

Leave your comment

Pin It on Pinterest

Share This