Installing Java on your Linux box

pradeep's Avatar author of Installing Java on your Linux box
This is an article on Installing Java on your Linux box in Linux.
Rated 5.00 By 1 users
Java is a fairly important technology to have on any operating system. Countless Web sites make use of Java or JavaScript; programs such as Zend Studio are Java applications that require the Java Runtime Environment; and many developers develop in Java. Unfortunately, most Linux distributions do not ship with Java due to its license fee. Certain Java implementations are free, such as GCJ, or the GNU Compiler for Java, but it isn't Sun's Java implementation, which is arguably the better of the two.

Luckily, installing Java on your Linux system is extremely simple. Visit the Java download Web site and select the operating system you'd like to download for (Linux, Linux AMD64, Solaris, etc.). Once you've chosen the download file—either a self-extracting executable or a self-extracting RPM file—you can install it.
 # mkdir -p /usr/local/java
 # cd /usr/local/java
 # mv /path/to/jre-1_5_0_05-linux-amd64.bin .
 # chmod u+x jre-1_5_0_05-linux-amd64.bin
 # ./jre-1_5_0_05-linux-amd64.bin
The installation must be done as root if you want the Java installation to be site-wide; if you want it just for yourself, you can extract the package in ~/bin/java or some other appropriate location. In the above, the JRE is installed in /usr/local/java/jre1.5.0_05/.

As a quick test, run the java executable:
 # cd jre1.5.0_05/bin
 # ./java -version
To make Java available to all users, add it to the default PATH settings by editing /etc/profile and adding:
 export $PATH $JAVA_HOME
napster_hacker17's Avatar
Newbie Member
jhon_lewis's Avatar, Join Date: Mar 2010
Newbie Member
Corwin's Avatar, Join Date: Mar 2010
Newbie Member
Yep, this is all you need :-)
unni krishnan.r's Avatar, Join Date: Apr 2010
Skilled contributor
aalso remind you java is now available int hte ubuntu software center availabe wih ubuntu