Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Emerge jdk-1.6 and jdk-1.5 on the same machine?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
john.newman
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2009
Posts: 85

PostPosted: Wed Aug 24, 2011 2:11 am    Post subject: [SOLVED] Emerge jdk-1.6 and jdk-1.5 on the same machine? Reply with quote

Hello

# java-config -L

*) IcedTea6-bin 1.10.3 [icedtea6-bin]
2) Sun JDK 1.6.0.26 [sun-jdk-1.6]

I have the sun jdk 1.6 installed. I'm not using it for anything yet, but I'm expecting to need it at some point due iced-tea lacking those com.sun packages that people tend to use :x It's really unfortunate.. :roll: Anyway, in addition to those two versions, which I must keep as-is, I also need to install an old copy of sun-jdk-1.5u22 for a certain application that is far from compatible with jdk-1.6.

What is the best way to do that with portage? Leaving java out of it for a second, how do I get two versions of the same package? If I add an entry to package.mask the newer version is gone with a --depclean right?

The goal is:

# java-config -L

*) IcedTea6-bin 1.10.3 [icedtea6-bin]
2) Sun JDK 1.6.0.26 [sun-jdk-1.6]
3) Sun JDK 1.5.0.22 [sun-jdk-1.5]

Then I will create a "tomcat" user, and set its user vm to option 3, leaving system and most other users at option 1. That is a very nice feature :idea:, this java-config tool has been quite helpful so far. I just can't figure out how to get two versions of the same package with portage... :?:


Last edited by john.newman on Wed Aug 24, 2011 3:22 am; edited 2 times in total
Back to top
View user's profile Send private message
john.newman
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2009
Posts: 85

PostPosted: Wed Aug 24, 2011 3:14 am    Post subject: Reply with quote

OK I think I figured it out. You generally cannot have two versions in the same package "slot", because version A would most likely clobber the files from version B.

Also jdk-1.5 has been retired from the portage repositories (good), it is only available in the java overlay

Code:
# emerge -pv layman
# echo "app-portage/layman subversion git" >> /etc/portage/package.use
# emerge -v layman
# layman -S
# layman -a java-overlay
# echo "source /var/lib/layman/make.conf" >> /etc/make.conf   
# emerge -1v =sun-jdk-1.5.0.22-r1
# echo ">=dev-java/sun-jdk-1.5.0.22-r1:1.5 ~amd64"  >> /etc/portage/package.keywords
# emerge -1v =sun-jdk-1.5.0.22-r1
# java-config -L
The following VMs are available for generation-2:
1)      IcedTea6-bin 1.10.3 [icedtea6-bin]
*)      Sun JDK 1.5.0.22 [sun-jdk-1.5] (Build Only)
3)      Sun JDK 1.6.0.26 [sun-jdk-1.6]

VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL.
Gentoo recommends not setting these VMs as either your System or User VM.
Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information

# java-config -S 1
# java-config -L
The following VMs are available for generation-2:
*)      IcedTea6-bin 1.10.3 [icedtea6-bin]
2)      Sun JDK 1.5.0.22 [sun-jdk-1.5] (Build Only)
3)      Sun JDK 1.6.0.26 [sun-jdk-1.6]

VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL.
Gentoo recommends not setting these VMs as either your System or User VM.
Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information

# layman -d java-overlay

# useradd -r -s /bin/bash -m -d /opt/tomcat tomcat
# passwd tomcat
# su tomcat
$ java-config -s 2
Now using sun-jdk-1.5 as your user JVM
!!! WARNING: sun-jdk-1.5 is marked as a build-only JVM. Using this vm is not recommended.
!!! WARNING: Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information.

$ java-config-2 -L
The following VMs are available for generation-2:
1)      IcedTea6-bin 1.10.3 [icedtea6-bin]
*)      Sun JDK 1.5.0.22 [sun-jdk-1.5] (Build Only)
3)      Sun JDK 1.6.0.26 [sun-jdk-1.6]

VMs marked as Build Only may contain Security Vulnerabilities and/or be EOL.
Gentoo recommends not setting these VMs as either your System or User VM.
Please see http://www.gentoo.org/doc/en/java.xml#build-only for more information

$ exit

# java-config -L
The following VMs are available for generation-2:
*)      IcedTea6-bin 1.10.3 [icedtea6-bin]
2)      Sun JDK 1.5.0.22 [sun-jdk-1.5] (Build Only)
3)      Sun JDK 1.6.0.26 [sun-jdk-1.6]


And I think that will work. :idea:


Last edited by john.newman on Wed Aug 24, 2011 3:22 am; edited 2 times in total
Back to top
View user's profile Send private message
dol-sen
Retired Dev
Retired Dev


Joined: 30 Jun 2002
Posts: 2805
Location: Richmond, BC, Canada

PostPosted: Wed Aug 24, 2011 3:16 am    Post subject: Reply with quote

The java team was able to slot the jdk's so you just need to find the old 1.5 ebuild and put it in your local overlay (there are instructions for that) and install it. Use java-config to select the java runtime you need then run the app.

You want to look in the attic ;)

Ah, you figured it out. Good. I didn't know they kept it around in the java overlay.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum