Você está na página 1de 3

Installation of Java in Linux

Follow these steps to download and install Java for Linux.

1. Download
2. Install

Download

1. Go to http://java.com and click on the Download button


2. There are two types of installation packages.
o Linux self extracting binary file
This file can be used to install Java in a location chosen by the user and can be installed by anyone
(not only root users). .
o Linux RPM package
Linux RPM (Redhat Package Manager) uses RPM to install Java. In order to use this method, you
need to have RPM available on your system.

Download the package that best suits your needs. You can download the file to any of the directories on your system.

Installation of Java 6

• Linux self extracting binary file


• Linux RPM package

To install the Linux (self-extracting) file :: .bin file

Follow these instructions:

1. Change the permission of the file you downloaded to be executable. Type:


chmod a+x jre-6u<version>-linux-i586.bin
2. Verify that you have permission to execute the file. Type:
ls -l

3. Change to the directory in which you want to install. Type:


cd <directory path name>
For example, to install the software in the /usr/java/ directory, Type:
cd /usr/java/
4. Run the self-extracting binary Type:
./jre-6u<version>-linux-i586.bin

The license agreement is displayed. Review the agreement. Press the spacebar to display the next page. At
the end, enter yes to proceed with the installation.

5. Java is installed into its own directory. When the installation has completed, you will see the word Done.

6. Verify that the jre1.6.0_<version> sub-directory is listed under the current directory. Type:
ls

The installation is now complete.

To install the Linux RPM (self-extracting) file :: .rpm file

Follow these instructions:

1. Become the root user by running the su command and entering the super-user password.
At the terminal: Type:
su
Enter the root password.
2. Change to the directory in which you want to install. Type:
cd <directory>
For example, to install the software in the /usr/java/ directory, Type:
cd /usr/java

Note about root access: To install Java in a system-wide location such as/usr/local, you must login as the
root user to gain the necessary permissions. If you do not have root access, install Java in your home
directory or a subdirectory for which you have write permissions.

3. Change the permission of the file you downloaded to be executable. Type:


chmod a+x jre-6u<version>-linux-i586-rpm.bin

Verify that you have permission to execute the file. Type:


ls -l
4. To start the installation process, type:
./jre-6u<version>-linux-i586-rpm.bin

Note: If the file is in the current directory, prepend it with "./"

This displays a binary license agreement. Read through the agreement. Press the spacebar to display the
next page. At the end, enter yes to proceed with the installation.

5. The installation file creates and runs the file jre-6<version>-linux-i586.rpm in the current
directory. When the installation has completed, you will see the word Done.
6. Run the RPM command at the terminal to install the packages. Type:
rpm -iv jre-6<version>-linux-i586.rpm
7. The JRE is installed in jre1.6.0_<version number> sub-directory under the current
directory.To Verify that the jre1.6.0_<version> sub-directory is listed under the current
directory. Type:
ls

The installation is now complete.

Você também pode gostar