system version : Red Hat Enterprise Linux as Release 4
Linux kernel : 2.6.9-89.ELLARGESMP
Today you need to run a Java program on the server and upload it locally to the server after the program is called a Count.jar executable package. Then with Java-jar Count.jar run, the result unexpectedly appears the error, the general meaning of the error is not support-jar parameter. I go, this is what version of Java Ah, unexpectedly does not support running jars. Run java-version check, get version is 1.4 .... 1.4. A good old version. For my program, I decided to upgrade it.
1. Run sudo rpm-qa |grep java to get the system installed JAVA-1.4.2-GCJ-COMPAT-1.4.2.0-27JPP and gcc-java-3.4.6-11. The first one is the Java package we want to uninstall.
2. Run sudo rpm-e java-1.4.2-gcj-compat-1.4.2.0-27jpp Uninstall system with its own package.
3. Download jdk-7u3-linux-x64.rpm to the Java website and upload it to the server.
4. Run sudo rpm-i jdk-7u3-linux-x64.rpm command to install jdk1.7. The result is an error, and the error message is displayed as:/lib64/tls/libc.so.6:version ' glibc_2.4 ' not found (required by/usr/java/jdk1.7.0_03/bin/unpack200). It seems likely that the glibc version is not high enough to use the sudo rpm-qa |grep glibc command query, that the system installed is 2.3 version. Since GLIBC is an underlying LIB library, many software relies on thesaurus, so it is not recommended to upgrade the library directly. I chose to install the old version of Java.
5. Go to the Java official website download Jdk-6u31-linux-x64-rpm.bin, pass to the server.
6. Run sudo chmod +x jdk-6u31-linux-x64-rpm.bin to make it a running program.
7. Run the sudo./jdk-6u31-linux-x64-rpm.bin command to install jdk1.6. Result Error: Package Jdk-1.7.0_03-fcs (which is newer than JDK-1.6.0_31-FCS) is already installed file/etc/init.d/j exec from install of Jdk-1.6.0_31-fcs conflicts with file from package Jdk-1.7.0_03-fcs. It seems that although the 1.7 did not install successfully, some files have been released into the system, resulting in the 1.6 version did not install successfully.
8. Based on the above error analysis, jdk1.7 's package name should be Jdk-1.7.0_03-fcs (the package cannot be found using the RPM-QA command). Run the sudo rpm-e Jdk-1.7.0_03-fcs command to delete the remnants of the jdk1.7 file.
9. Run the sudo./jdk-6u31-linux-x64-rpm.bin command again. The installation was successful.
The whole process is analyzed with the following points to note:
1. Note the prompts during the installation process.
2. The error of what the general report needs is due to the legacy of some Lib package version, when the general choice is to upgrade the dependency pack or select an older version.
The above process is also possible to pass the test on the CentOS. The so-called Rpm.bin end of the package name, generally executable file, running, will automatically release the RPM package and installation, installation directory for/usr/java/, and environment variables have been configured, no need to configure the/etc/profile. The JDK installed in the general Linux distribution is OPENJDK, and the versions are generally older.