Install Multiple JDK in centos

Source: Internet
Author: User

The default setting is openjdk 1.7. the hivedb compilation does not seem to be 1.5, but it does not work./tmp/hivedb-master/src/main/Java/org/hivedb/META/persistence/hivebasicdatasource is reported. java: [13,7] error: hivebasicdatasource is not abstract and does not override abstract method getparentlogger () in commondatasource

First, it must be a 64-bit machine.

Uname-
Linux cs-node1 2.6.32-279. el6.x86 _ 64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html#jdk-1.5.0_22-oth-JPR

Download 1.5jdk

At the beginning of the jdk-1_5_0_22-linux-amd64-rpm.bin don't think it is AMD, is to install this. Jdk-1_5_0_22-linux-i586-rpm.bin is 32-bit.

Upload the file to a Linux host using FTP, and run chmod 777 directly.

/Jdk-1_5_0_22-linux-amd64-rpm.bin

When the license is available, CRL + C should be upgraded to yes or no. Install

---------------------------

Unpacking...
Checksumming...
0
0
Extracting...
Unzipsfx 5.50 of 17 February 2002, by Info-zip (Zip-Bugs@lists.wku.edu ).
Inflating: jdk-1_5_0_22-linux-amd64.rpm
Preparing... ######################################## ### [100%]
1: JDK ####################################### #### [100%]
 
Done.

--

Installed successfully,

Check the installation location

Find/-name Java
/Var/lib/alternatives/Java
/Root/. m2/Repository/NET/Java
/Root/. m2/repository_jw/NET/Java
/Etc/pki/Java
/Etc/Java
/Etc/alternatives/Java
/Opt/Continuent/releases/tungsten-enterprise-1.5.3-85_pid17929/tunststen-Replicator/samples/extensions/Java
/Usr/lib/Java
/Usr/lib/JVM/java-1.6.0-openjdk-1.6.0.0.x86_64/JRE/bin/Java
/Usr/lib/JVM/java-1.7.0-openjdk-1.7.0.3.x86_64/JRE/bin/Java
/Usr/lib/JVM/java-1.7.0-openjdk-1.7.0.3.x86_64/bin/Java
/Usr/lib/JVM/java-1.5.0-gcj-1.5.0.0/JRE/bin/Java
/Usr/lib/JVM/Java
/Usr/lib/JVM-exports/Java
/Usr/Java
/Usr/Java/jdk1.5.0 _ 22/JRE/bin/Java
/Usr/Java/jdk1.5.0 _ 22/bin/Java
/Usr/bin/Java
/Usr/share/Java
/Tmp/tunststen-enterprise-1.5.3-85/tunststen-Replicator/samples/extensions/Java
/Tmp/hivedb-master/src/test/Java
/Tmp/hivedb-master/src/main/Java

--

Set Environment Variables

VI/etc/profile

Export java_home =/usr/Java/jdk1.5.0 _ 22

--

Added the Java executable file option --- set the default option

[Root @ cs-node1 Java] # alternatives -- install/usr/bin/Java/usr/Java/jdk1.5.0 _ 22/bin/Java 60

[Root @ cs-node1 Java] # alternatives -- config Java

There are 4 programs which provide 'java '.

Selection command
-----------------------------------------------
/Usr/lib/JVM/jre-1.5.0-gcj/bin/Java
* + 2/usr/lib/JVM/jre-1.6.0-openjdk.x86_64/bin/Java
2/usr/lib/JVM/jre-1.7.0-openjdk.x86_64/bin/Java
4/usr/Java/jdk1.5.0 _ 22/bin/Java

Enter to keep the current selection [+], or type selection number: 4
[Root @ cs-node1 Java] # Java-version
Java version "1.5.0 _ 22"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0 _ 22-b03)
Java hotspot (TM) 64-bit server VM (build 1.5.0 _ 22-b03, mixed mode)

--

So far, someProgramUse the default JDK. Or use. For example, hivedb for compiling. Re-open an SSH window or clone one. To make the newly installed JDK take effect.

Q: I have selected alternatives -- config java. Is it automatically changed in profile? N/

Reference http://www.linuxidc.com/Linux/2012-09/71358.htm,http://johnsz.blog.51cto.com/525379/694052

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.