Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Adding Oracle's JDK as Java 1.6 option

...

Code Block
[root@c5 ~]# lsb_release -a
LSB Version:	:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor ID:	CentOS
Description:	CentOS release 5.8 (Final)
Release:	5.8
Codename:	Final

Install Java JDK 1.6

You have two options for Java JDK 1.6:

  • OpenJDK or
  • Oracle Java JDK

Note that you need the JDK (not just the JRE) and the version must be 1.6.

Option: OpenJDK 1.6

You can use CentOS repositories to get this one and it's quite straight forwar

Code Block
[root@c5 ~]# yum install java-1.6.0-openjdk java-1.6.0-openjdk-devel
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.27.1.10.8.el5_8 set to be updated
--> Processing Dependency: jpackage-utils >= 1.7.3-1jpp.2 for package: java-1.6.0-openjdk
--> Processing Dependency: libasound.so.2(ALSA_0.9)(64bit) for package: java-1.6.0-openjdk
--> Processing Dependency: libasound.so.2(ALSA_0.9.0rc4)(64bit) for package: java-1.6.0-openjdk
--> Processing Dependency: tzdata-java for package: java-1.6.0-openjdk
--> Processing Dependency: libXtst.so.6()(64bit) for package: java-1.6.0-openjdk
--> Processing Dependency: libasound.so.2()(64bit) for package: java-1.6.0-openjdk
--> Processing Dependency: libgif.so.4()(64bit) for package: java-1.6.0-openjdk
--> Running transaction check
---> Package alsa-lib.x86_64 0:1.0.17-1.el5 set to be updated
---> Package giflib.x86_64 0:4.1.3-7.3.3.el5 set to be updated
---> Package jpackage-utils.noarch 0:1.7.3-1jpp.2.el5 set to be updated
---> Package libXtst.x86_64 0:1.0.1-3.1 set to be updated
---> Package tzdata-java.x86_64 0:2012c-3.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                        Arch               Version                                    Repository           Size
========================================================================================================================
Installing:
 java-1.6.0-openjdk             x86_64             1:1.6.0.0-1.27.1.10.8.el5_8                updates              36 M
Installing for dependencies:
 alsa-lib                       x86_64             1.0.17-1.el5                               base                414 k
 giflib                         x86_64             4.1.3-7.3.3.el5                            base                 39 k
 jpackage-utils                 noarch             1.7.3-1jpp.2.el5                           base                 61 k
 libXtst                        x86_64             1.0.1-3.1                                  base                 16 k
 tzdata-java                    x86_64             2012c-3.el5                                updates             181 k

Transaction Summary
========================================================================================================================
Install       6 Package(s)
Upgrade       0 Package(s)

Total download size: 37 M
Downloading Packages:
(1/6): libXtst-1.0.1-3.1.x86_64.rpm                                                              |  16 kB     00:00     
(2/6): giflib-4.1.3-7.3.3.el5.x86_64.rpm                                                         |  39 kB     00:00     
(3/6): jpackage-utils-1.7.3-1jpp.2.el5.noarch.rpm                                                |  61 kB     00:00     
(4/6): tzdata-java-2012c-3.el5.x86_64.rpm                                                        | 181 kB     00:00     
(5/6): alsa-lib-1.0.17-1.el5.x86_64.rpm                                                          | 414 kB     00:00     
(6/6): java-1.6.0-openjdk-1.6.0.0-1.27.1.10.8.el5_8.x86_64.rpm                                   |  36 MB     00:02     
------------------------------------------------------------------------------------------------------------------------
Total                                                                                    16 MB/s |  37 MB     00:02     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : alsa-lib                                                                                         1/6 
  Installing     : giflib                                                                                           2/6 
  Installing     : libXtst                                                                                          3/6 
  Installing     : jpackage-utils                                                                                   4/6 
  Installing     : tzdata-java                                                                                      5/6 
  Installing     : java-1.6.0-openjdk                                                                               6/6 

Installed:
  java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.27.1.10.8.el5_8                                                                 

Dependency Installed:
  alsa-lib.x86_64 0:1.0.17-1.el5     giflib.x86_64 0:4.1.3-7.3.3.el5      jpackage-utils.noarch 0:1.7.3-1jpp.2.el5    
  libXtst.x86_64 0:1.0.1-3.1         tzdata-java.x86_64 0:2012c-3.el5    

Complete!
[root@c5 ~]# java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.8) (rhel-1.27.1.10.8.el5_8-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)
[root@c5 ~]# 

Option: Oracle Java JDK 1.6

Go to Oracle Java Download and download the RPM for Oracle's Java JDK 1.6. You will need to agree to their terms and conditions, so most likely you would want to use a browser and the copy the file over to your server.

Remember that you need the JDK and not just the JRE.

Once you downloaded the file, proceed to the installation as follows:

Code Block

[root@centos tmp]# chmod +x jdk-6u43-linux-x64-rpm.bin 
[root@centos tmp]# ./jdk-6u43-linux-x64-rpm.bin 
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
  inflating: jdk-6u43-linux-amd64.rpm  
  inflating: sun-javadb-common-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-core-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-client-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm  
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
	rt.jar...
	jsse.jar...
	charsets.jar...
	tools.jar...
	localedata.jar...
	plugin.jar...
	javaws.jar...
	deploy.jar...
Installing JavaDB
Preparing...                ########################################### [100%]
   1:sun-javadb-common      ########################################### [ 17%]
   2:sun-javadb-core        ########################################### [ 33%]
   3:sun-javadb-client      ########################################### [ 50%]
   4:sun-javadb-demo        ########################################### [ 67%]
   5:sun-javadb-docs        ########################################### [ 83%]
   6:sun-javadb-javadoc     ########################################### [100%]

Java(TM) SE Development Kit 6 successfully installed.

Product Registration is FREE and includes many benefits:
* Notification of new versions, patches, and updates
* Special offers on Oracle products, services and training
* Access to early releases and documentation

Product and system data will be collected. If your configuration
supports a browser, the JDK Product Registration form will
be presented. If you do not register, none of this information
will be saved. You may also register your JDK later by
opening the register.html file (located in the JDK installation
directory) in a browser.

For more information on what data Registration collects and 
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html

Press Enter to continue.....

 
Done.

Check that everything is installed properly:

Code Block

[root@centos tmp]# java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)

Installing MySQL Server

Code Block

[root@c5 ~]# yum install mysql-server
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-server.x86_64 0:5.0.95-1.el5_7.1 set to be updated
--> Processing Dependency: mysql = 5.0.95-1.el5_7.1 for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: mysql-server
--> Processing Dependency: perl-DBD-MySQL for package: mysql-server
--> Processing Dependency: perl(DBI) for package: mysql-server
--> Processing Dependency: perl-DBI for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15(libmysqlclient_15)(64bit) for package: mysql-server
--> Processing Dependency: libmysqlclient_r.so.15()(64bit) for package: mysql-server
--> Processing Dependency: libmysqlclient.so.15()(64bit) for package: mysql-server
--> Running transaction check
---> Package mysql.x86_64 0:5.0.95-1.el5_7.1 set to be updated
---> Package perl-DBD-MySQL.x86_64 0:3.0007-2.el5 set to be updated
---> Package perl-DBI.x86_64 0:1.52-2.el5 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                        Arch                   Version                            Repository               Size
========================================================================================================================
Installing:
 mysql-server                   x86_64                 5.0.95-1.el5_7.1                   updates                 9.9 M
Installing for dependencies:
 mysql                          x86_64                 5.0.95-1.el5_7.1                   updates                 4.9 M
 perl-DBD-MySQL                 x86_64                 3.0007-2.el5                       base                    148 k
 perl-DBI                       x86_64                 1.52-2.el5                         base                    600 k

Transaction Summary
========================================================================================================================
Install       4 Package(s)
Upgrade       0 Package(s)

Total download size: 15 M
Downloading Packages:
(1/4): perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm                                                    | 148 kB     00:00     
(2/4): perl-DBI-1.52-2.el5.x86_64.rpm                                                            | 600 kB     00:00     
(3/4): mysql-5.0.95-1.el5_7.1.x86_64.rpm                                                         | 4.9 MB     00:00     
(4/4): mysql-server-5.0.95-1.el5_7.1.x86_64.rpm                                                  | 9.9 MB     00:00     
------------------------------------------------------------------------------------------------------------------------
Total                                                                                    17 MB/s |  15 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : perl-DBI                                                                                         1/4 
  Installing     : mysql                                                                                            2/4 
  Installing     : perl-DBD-MySQL                                                                                   3/4 
  Installing     : mysql-server                                                                                     4/4 

Installed:
  mysql-server.x86_64 0:5.0.95-1.el5_7.1                                                                                

Dependency Installed:
  mysql.x86_64 0:5.0.95-1.el5_7.1        perl-DBD-MySQL.x86_64 0:3.0007-2.el5        perl-DBI.x86_64 0:1.52-2.el5       

Complete!
[root@c5 ~]# 

...