Showing posts with label How to install JAVA on LINUX ?. Show all posts
Showing posts with label How to install JAVA on LINUX ?. Show all posts

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.

How to install JAVA on LINUX ?



Download the JDK

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 “*.tar.gz” version.

Download the file as a .gz. Save it to your GNU/Linux machine.

Switch to the directory where you saved the file. You do not need to be a root and only must have the write access to the folder where you wish to install Java. If your administrator is not supportive, you may need to place Java into your home folder or (even better) on some shared network location

Decompress the file. For example, you could do this in your home folder. Decompressing will create a folder called “jdk1.7.0_09”. Java is now installed.
  • The installed Java jre is rather independent and can be easily moved into another place just by copying all its files.
  • You can install multiple different jre's this way: they coexist together and can be used if some software requires the older version to run.
Launch Java. The Java executable you need to launch is located in a subfolder, called "bin." This way of installation will not configure a default Java command for you — you must do this manually or always include the full path in your startup script.