LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-04-2013, 12:44 AM   #1
Predatorian
Member
 
Registered: Mar 2008
Location: currently, where ever the army takes me
Distribution: Debian Lenny/Ubuntu or Arch Linux
Posts: 145

Rep: Reputation: 28
Install and use older version of Java while keeping newst version


Hello LQ'ers.

I watched my friend do this, but he's not around or answering his phone, but he was able to have two versions of java installed on his linux machine, which was Fedora 17 at the time, and use the older one because of incompatibilities with jdk-7u21-linux-i586.rpm. I would like to install jdk-6u43-linux-i586.rpm on CentOS 6.4 32bit. From some of my reading, I am supposed to be able to do this with 'alternatives' but as I enter the command
Code:
alternatives --display 'java'
there is nothing dipslayed, yet when I do a
Code:
java -version
I get the version:
Code:
$ java -version
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
A program I am trying to run, is not working with 1.7, and I believe it will work with 1.6. When I try installing the jdk-6u43-linux-i586.rpm I get this error.
Code:
$ sudo rpm -i jdk-6u43-linux-i586.rpm
        package jdk-2000:1.7.0_21-fcs.i586 (which is newer than jdk-2000:1.6.0_43-fcs.i586) is already installed
        file /etc/init.d/jexec from install of jdk-2000:1.6.0_43-fcs.i586 conflicts with file from package jdk-2000:1.7.0_21-fcs.i586
Isn't there something that will allow me to select a version of java just like RVM does with different versions of Ruby?

Last edited by Predatorian; 06-04-2013 at 12:48 AM.
 
Old 06-05-2013, 04:03 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,316

Rep: Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578Reputation: 3578
When jdk6 is installed, you can select java version with :
# /usr/sbin/alternatives --config java


? No jdk6 entry in /etc/alternatives/ ? Then an entry can be installed with :
# /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_43/bin/java 2
.. When you have checked that the path really is "/usr/java/jdk1.6.0_43/bin/java"

-
 
Old 06-12-2013, 02:13 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,765

Rep: Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050
Anyone have the same advice for Arch? I am trying to get sqldeveloper installed and have been told that it is not supported by jdk 1.7 and needs 1.6

The irony is not lost on me though ... I am running Arch in Virtualbox and trying to execute Sql Developer and need Java support ... 3 of the 4 are owned by Oracle!!!
 
Old 06-13-2013, 07:49 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,765

Rep: Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050Reputation: 3050
Well in case it helps (not sure my issue was the same after finding solution), I found the following useful:

Better approach: uninstall jre6 & jdk6; install jre7-openjdk, jdk7-openjdk with pacman. Then download the jdk6 .bin file from the Oracle website (jdk-6u30-linux-x64.bin at time of writing), copy it to /opt, run the .bin file as root, rename the jdkxxxx folder to "java". Now you have a jdk6 folder that is independent from the pacman repos.


This was found here
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Install an Older Version of Java in Ubuntu LXer Syndicated Linux News 0 09-19-2011 09:10 PM
building older version of kernel on newer version machine chakradhar.nannuri Linux - Newbie 4 01-25-2011 10:46 PM
Firefox not emerging because of autoconf version - how to force older version? sirgregsalot Linux - Desktop 5 12-11-2006 07:37 PM
What if I need to install an older version of selinux ? hq4ever Fedora 3 04-30-2006 12:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration