1- Install package libgcc for support install java
[root@localhost soft]# yum install -y libgcc.i686Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package libgcc.i686 0:4.8.5-4.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
============================================================
Package Arch Version Repository Size
============================================================
Installing: libgcc i686 4.8.5-4.el7 InstallMedia 103 k
Transaction Summary
============================================================
Install 1 Package
Total download size: 103 k
Installed size: 190 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libgcc-4.8.5-4.el7.i686 1/1
Verifying : libgcc-4.8.5-4.el7.i686 1/1
Installed:
libgcc.i686 0:4.8.5-4.el7
Complete!
2- Install package java
[root@localhost soft]# rpm -ivh jdk-7u75-linux-i586.rpmPreparing... ################################# [100%]
Updating / installing...
1:jdk-2000:1.7.0_75-fcs ################################# [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
tools.jar...
localedata.jar...
jfxrt.jar...
plugin.jar...
javaws.jar...
deploy.jar...
[root@localhost soft]#
3- Add java installed path to java profile
[root@localhost soft]# alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_75/bin/java 2[root@localhost soft]#
4- Set default java version
[root@localhost soft]# alternatives --config javaThere are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
* 1 /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64/jre/bin/java
+ 2 /usr/java/jdk1.7.0_75/bin/java
Enter to keep the current selection[+], or type selection number: 2
[root@localhost soft]#
5- Check java version
[root@localhost soft]# java -versionjava version "1.7.0_75"
Java(TM) SE Runtime Environment (build 1.7.0_75-b13)
Java HotSpot(TM) Server VM (build 24.75-b04, mixed mode)
[root@localhost soft]#
No comments:
Post a Comment