How to install java jdk in RHEL?
Solution 1
Try to run it using sh itself, i.e
sh jdk-6u24-linux-i586-rpm.bin
Solution 2
Please make sure you are doing correct.
To install the Linux RPM (self-extracting) file Follow these instructions:
-
Become the root user by running the su command and entering the super-user password. At the terminal: Type:
su
Enter the root password.
-
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.
-
Change the permission of the file you downloaded to be executable. Type:
chmod a+x jre-6u<version>-linux-i586-rpm.bin
-
Start the installation process. Type:
./jre-6u<version>-linux-i586-rpm.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.
-
The installation file creates and runs the file jre-6-linux-i586.rpm in the current directory.
RPM unpacking completes
-
Verify that the jre1.6.0_ sub-directory is listed under the current directory. Type:
ls
Verify the installation filename
Also refer: http://www.java.com/en/download/help/linux_install.xml#rpm
Comments
-
O_O almost 2 years
I am following example commands from other sites but it isn't helping!
What am I doing wrong?
chmod +x jdk-6u24-linux-i586-rpm.bin ./jdk-6u24-linux-i586-rpm.bin
Results give me:
bash: ./jdk-6u24-linux-i586-rpm.bin: /bin/sh: bad interpreter: Permission denied
Ok.. after doing
sh jdk-6u24-linux-i586-rpm.bin
as suggested below, I get this:
Did the install fail? Is the file corrupted??? Thanks!!
-
uthark about 13 yearsDid you try it to run as normal user or as root?
-
O_O about 13 yearsI first was root, but the file was in my /media folder so I went into there... was it because the file was not in the root directory?
-
uthark about 13 yearsHmm. maybe your user doesn't have read permission to file, but has exec permission? Do ls -l jdk-6u24-linux-i586-rpm.bin and if file cannot be read by others, then do chmod o+r jdk-6u24-linux-i586-rpm.bin. Anyway, I think that JDK should be installed by root in the systemwide directory.
-
O_O about 13 yearsAh.. ok I think I fixed it by putting the jdk bin file in root instead of leaving it in the /media folder. Is it suggested to install all programs in the root folder?
-
uthark about 13 yearsNo, your rpm file can be anywhere.
-
uthark about 13 yearsIt seems that unpacked file ./install.sfx.20555 is not executable. Does your partition mounted with "exec" option? Also, do you have 32 or 64 bit system?
-
O_O about 13 yearsI am not sure about the "exec" option and how I can check.. I have a 32 bit system.
-
uthark about 13 yearsok, show output of command "mount | grep noexec". Also, you can download plain binary from Oracle site and try it.
-
O_O about 13 yearsOutput of command "mount | grep noexec" is /dev/sdb1 on /media/1C type vfat (rw,noexec,nosuid,nodev,shortname=winnt,uid=0)
-
O_O about 13 yearsuthark, I think the java jdk install is fine.. everything went ok after I moved the install bin file to the root directory. Not sure what happened when it was in the /media folder though...
-
uthark about 13 yearsHeh. As you can see, you /media/1C is mounted as noexec. So, any files that are placed on that drive cannot be executed, that is why installation failed until you moved it to the /root directory, which, I assume is mounted with exec option.
-
O_O about 13 yearsoooohh... cool beans. Thanks for all your help uthark! :)
-