How to Switch java version on CentOS 6


[root@localhost Flow]# alternatives –config java

There are 4 programs which provide ‘java’.

Selection    Command
———————————————–
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
3           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
+ 4           /opt/jdk1.8.0_45/bin/java

Enter to keep the current selection[+], or type selection number: 1
[root@localhost Flow]# java -version
java version “1.7.0_71”
OpenJDK Runtime Environment (rhel-2.5.3.2.el6_6-x86_64 u71-b14)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s