Install Opendaylight and upgrade Java on RHEL6.3

1. Upgrade java openjdk to 1.7.0

[root@frank ~]# yum install java-1.7.0-openjdk.x86_64

2. Check version and choose correct java

[root@frank ~]# java -version
java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (rhel-1.45.1.11.1.el6-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
[root@frank ~]# alternatives --config java
There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /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
Enter to keep the current selection[+], or type selection number: 2
[root@frank ~]# java -version
java version "1.7.0_03-icedtea"  <<<
OpenJDK Runtime Environment (rhel-2.1.el6.7-x86_64)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)


3. Check whether now java is OK
Only found “jre”, no “lib”

[frank@frank ~]$ cd /usr/lib/jvm/
[frank@frank jvm]$ ll
total 8
drwxr-xr-x. 3 root root 4096 Sep  8 19:53 java-1.6.0-openjdk-1.6.0.0.x86_64
drwxr-xr-x. 3 root root 4096 Sep  8 22:25 java-1.7.0-openjdk-1.7.0.3.x86_64
lrwxrwxrwx. 1 root root   21 Sep  8 22:27 jre -> /etc/alternatives/jre
lrwxrwxrwx. 1 root root   27 Sep  8 19:53 jre-1.6.0 -> /etc/alternatives/jre_1.6.0
lrwxrwxrwx. 1 root root   37 Sep  8 19:53 jre-1.6.0-openjdk.x86_64 -> java-1.6.0-openjdk-1.6.0.0.x86_64/jre
lrwxrwxrwx. 1 root root   27 Sep  8 22:25 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
lrwxrwxrwx. 1 root root   37 Sep  8 22:25 jre-1.7.0-openjdk.x86_64 -> java-1.7.0-openjdk-1.7.0.3.x86_64/jre <<< 
lrwxrwxrwx. 1 root root   29 Sep  8 22:25 jre-openjdk -> /etc/alternatives/jre_openjdk
[frank@frank jvm]$ 
[frank@frank jvm]$ cd java-1.7.0-openjdk-1.7.0.3.x86_64/
[frank@frank java-1.7.0-openjdk-1.7.0.3.x86_64]$ ls
jre  <<<

4. Install Openjdk-devel

[root@frank ~]# yum localinstall java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Local Package Process
Examining java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm: 1:java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64
Marking java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk-devel.x86_64 1:1.7.0.9-2.3.8.0.el6_4 will be installed
--> Processing Dependency: java-1.7.0-openjdk = 1:1.7.0.9-2.3.8.0.el6_4 for package: 1:java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64 (/java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64)
           Requires: java-1.7.0-openjdk = 1:1.7.0.9-2.3.8.0.el6_4
           Installed: 1:java-1.7.0-openjdk-1.7.0.3-2.1.el6.7.x86_64 (@frank-source)
               java-1.7.0-openjdk = 1:1.7.0.3-2.1.el6.7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

5. Install “1:1.7.0.9-2.3.8.0.el6_4:”

[root@frank ~]# yum install java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm 
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
Examining java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm: 1:java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64
Marking java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm as an update to 1:java-1.7.0-openjdk-1.7.0.3-2.1.el6.7.x86_64
Resolving Dependencies
--> Running transaction check
---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.3-2.1.el6.7 will be updated
---> Package java-1.7.0-openjdk.x86_64 1:1.7.0.9-2.3.8.0.el6_4 will be an update
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: 1:java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64
--> Finished Dependency Resolution
Error: Package: 1:java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64 (/java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64)
           Requires: libjpeg.so.62(LIBJPEG_6.2)(64bit)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

6. Install “libjpeg.so.62(LIBJPEG_6.2)(64bit)”

[root@frank ~]# yum localinstall libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm

7. Install failed rpm again

[root@frank ~]# yum install java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm
[root@frank ~]# yum localinstall java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64.rpm

8. Remove older version and check new version

[root@frank ~]# yum remove java-1.6.0-openjdk-1.6.0.0-1.45.1.11.1.el6.x86_64
[root@frank ~]# rpm -qa |grep java
java-1.7.0-openjdk-devel-1.7.0.9-2.3.8.0.el6_4.x86_64
tzdata-java-2012c-1.el6.noarch
java-1.7.0-openjdk-1.7.0.9-2.3.8.0.el6_4.x86_64

[root@frank ~]# cd /usr/lib/jvm
[root@frank jvm]# cd java-1.7.0-openjdk.x86_64/
[root@frank java-1.7.0-openjdk.x86_64]# ll
total 20
drwxr-xr-x. 2 root root 4096 Sep  8 23:01 bin
drwxr-xr-x. 3 root root 4096 Sep  8 23:01 include
drwxr-xr-x. 4 root root 4096 Sep  8 23:00 jre
drwxr-xr-x. 2 root root 4096 Sep  8 23:01 lib
drwxr-xr-x. 2 root root 4096 Sep  8 23:01 tapset

9. Set Java HOME Environment
I set “/etc/profile” that focus all user, but some guide set “~/.bashrc” that only focus user.

[root@frank ~]# vim /etc/profile
# need add follow environment data
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin:$PATH

[root@frank ~]# source /etc/profile

10. Download Opendaylight and run

[root@frank opendaylight]# pwd
/home/opendaylight
[root@frank opendaylight]# ll
total 55
drwxr-xr-x. 6 root root  1024 Sep  8 23:14 configuration
drwxr-xr-x. 2 root root  1024 Jan 27  2014 lib
drwxr-xr-x. 2 root root  1024 Sep  9 15:54 logs
drwxr-xr-x. 3 root root  1024 Sep  8 23:14 ObjectStore
drwxr-xr-x. 2 root root 22528 Jan 31  2014 plugins
drwxr-xr-x. 3 root root  1024 Sep  8 23:14 PutObjectStoreDirHere
-rw-r--r--. 1 root root  4571 Jan 27  2014 run.bat
-rwxr-xr-x. 1 root root  8121 Jan 27  2014 run.internal.sh
-rwxr-xr-x. 1 root root  1209 Jan 31  2014 run.sh <<< 
-rw-r--r--. 1 root root   363 Jan 27  2014 version.properties 
drwxr-xr-x. 4 root root  1024 Sep  8 23:14 work 
[root@frank opendaylight]#./run.sh 
...... 
osgi>

opendaylight

10.Set shell script for auto enable

[root@frank ~]# vim /etc/rc.d/rc.local
/home/opendaylight/run.sh
0
你可以留言,或者trackback 从你的网站

2 Responses to “Install Opendaylight and upgrade Java on RHEL6.3”

  1. Chastity说道:

    Do you mind if I quote a couple of your articles as long
    as I provide credit and sources back to your weblog?
    My blog is in the exact same area of interest as yours and my users would
    definitely benefit from a lot of the information you provide here.
    Please let me know if this ok with you. Thank you!

  2. frank说道:

    If use centos, you can direct to upgrade by “yum install java-1.8.0-openjdk”

留言哦