1

I have installed java in Centos 6.7 with version:

java -version
java version "1.6.0_38"
OpenJDK Runtime Environment (IcedTea6 1.13.10) (rhel-1.13.10.0.el6_7-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

I want to Downgrade the java version to

java -version
java version "1.6.0_17"
OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.20.b17.el5-x86_64)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

How to achieve this ?

Santosh Mohanty
  • 468
  • 1
  • 6
  • 23
  • Possible duplicate of [Downgrade java from version 8 to 7](http://stackoverflow.com/questions/23322024/downgrade-java-from-version-8-to-7) – user2004685 Jan 29 '16 at 12:48
  • Is there a specific reason you want to use an older build? – Thomas Jan 29 '16 at 12:50
  • Yes it is due to JVM Bugs encountered while Push Notifications: http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8013809 – Santosh Mohanty Jan 29 '16 at 13:29
  • Possible duplicate of [use different java version to run two programs](http://unix.stackexchange.com/questions/178875/use-different-java-version-to-run-two-programs) – CodeWarrior101 Jan 31 '16 at 10:18

2 Answers2

8

Install the version you need ,

# cd /<place you want java installed>/
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/<version>/jdk-<version>-linux-x64.tar.gz"

# tar xzf jdk-<version>-linux-x64.tar.gz

Install Java with alternatives,

# cd /<place java install>/jdk1.6.0_17/
# alternatives --install /usr/bin/java java /opt/jdk1.6.0_17/bin/java 2
# alternatives --config java

Then select the version want

There are 2 programs which provide 'java'.

Selection    Command
-----------------------------------------------
* + 1           /opt/jdk1.6.0_38/bin/java
2           /opt/jdk1.6.0_17/bin/java

Enter to keep the current selection[+], or type selection number: 

Enter 2

Thara Perera
  • 574
  • 6
  • 6
0

Try downloading and installing the specific version from Java downloads, then change the Java home path.

serenesat
  • 4,611
  • 10
  • 37
  • 53