How to install java on linux using RPM method ?



This method allows the installer to check the dependencies on some system libraries that may be missing. However, it does not support versioning easily and may fail even in some systems that do support RPMs. (Though the current Java installations are rather self-dependent and the required minimal requirements are usually satisfied anyway.)

Download the JDK

  • Click on the "Download" link under Java Platform (JDK) 7u9.
  • Accept the license and continue.

Select the right download. Under the "Product/File Description" you should pick your corresponding Linux option. For example, if you're running Linux x86 (32-bit), you need to choose the corresponding “*.rpm” version, for example “jdk-7u9-linux-i586.rpm”.

Download the .rpm file. Save it to your GNU/Linux machine.

Log in as root and switch to the directory where you saved the file. Or, become root by running su and entering the super-user password.

Install the rpm file by executing 'rpm -ivh filename.rpm', where filename is the name of your .rpm file. (Such as jdk-7u9-linux-i586.rpm).
·        You may receive a message telling that program “rpm” is not installed.
·        If that is the case the program “rpm” is not installed. You need to install it writing: sudo apt-get install rpm. Enter your password, and you're finished.

Create symbolic links. If you want to be able to execute this version of Java interpreter or compiler from any directory on your GNU/Linux system, you will have to create a few symbolic links:
o    sudo ln -s -v jdk1.7.0_09/bin/java /usr/bin/java
o    sudo ln -s -v jdk1.7.0_09/bin/javac /usr/bin/javac
o    Note that by installing using this method there could be dependencies that fail. It is better to use the package installer that handles all dependencies for you, since you will not be able to use Java correctly until the dependencies are resolved.

Installing Java with Ubuntu Using a Console

Enter one of the following commands into your console program:
·        sudo apt-get install openjdk-7-jdk openjdk-7-jre (if you don't want the browser plug-in)
·        sudo apt-get install openjdk-7-jdk openjdk-7-jre icedtea-7-plugin (if you do need the plug-in)
·        apt-get automatically takes care of the dependencies and lists the changes for confirmation.

Enter y to confirm the installation.

No comments:

Post a Comment