Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Java 5
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
NZLemming
n00b
n00b


Joined: 03 Apr 2005
Posts: 28
Location: Madrid, Spain

PostPosted: Tue Apr 05, 2005 3:33 pm    Post subject: Java 5 Reply with quote

I want to use my Gentoo box for Java dev, but the official Gentoo java packages only support Java 1.4. Is there a way to install JDK 5 (or 1.5, whatever you feel like calling it) in a Gentoo manner?

Thanks in advance!
Back to top
View user's profile Send private message
sunilgeo
n00b
n00b


Joined: 29 Jan 2005
Posts: 74

PostPosted: Tue Apr 05, 2005 3:39 pm    Post subject: Reply with quote

Try ACCEPT_KEYWORDS="~x86" emerge java
Back to top
View user's profile Send private message
abcdefg
Apprentice
Apprentice


Joined: 29 Feb 2004
Posts: 216
Location: The Netherlands

PostPosted: Tue Apr 05, 2005 3:44 pm    Post subject: Reply with quote

I think this means you want sun's jdk, this is how:
Code:
echo "dev-java/sun-jdk ~x86" >> /etc/portage/package.keywords
echo "dev-java/sun-jdk" >> /etc/portage/package.unmas
emerge sun-jdk


The emerge will tell you that you need to download a file manually from sun's site and put in in /usr/portage/distfiles

ps, a lot of programs will not run when using java 1.5 so you better install two java's and switch between them with java-config

Cheers,
David

edit: forgot that it is also masked


Last edited by abcdefg on Tue Apr 05, 2005 3:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
Voltago
Advocate
Advocate


Joined: 02 Sep 2003
Posts: 2593
Location: userland

PostPosted: Tue Apr 05, 2005 3:46 pm    Post subject: Reply with quote

Actually, what you should do is:
Code:
echo ">=sun-jdk-1.5" >> /etc/portage/package.unmask
echo "sun-jdk-1.5.02-r1 ~x86" >> /etc/portage/package.keywords
emerge sun-jdk

since JDK 5 is still hardmasked.
Back to top
View user's profile Send private message
abcdefg
Apprentice
Apprentice


Joined: 29 Feb 2004
Posts: 216
Location: The Netherlands

PostPosted: Tue Apr 05, 2005 3:48 pm    Post subject: Reply with quote

Voltage, you were too fast for me ;)
Back to top
View user's profile Send private message
NZLemming
n00b
n00b


Joined: 03 Apr 2005
Posts: 28
Location: Madrid, Spain

PostPosted: Tue Apr 05, 2005 4:11 pm    Post subject: Reply with quote

Fantastic! Thanks guys, I'll try it when I get home.

This community is great!
Back to top
View user's profile Send private message
db_404
Guru
Guru


Joined: 05 Dec 2002
Posts: 336

PostPosted: Tue Apr 05, 2005 6:13 pm    Post subject: Reply with quote

However there seem to me to be problems with Java 1.5 (or Java 5) on gentoo currently.

For example I use JEdit - this requires 'ant' to build, however some of ant's dependencies will not build with Java 1.5 (when built via emerge). This can be worked around by setting the system Java compiler to an earlier version - however if you have compiled any of the dependencies dependencies (follow me?) with 1.5 this will fail with a version error. I am in this situation now, and it tends to involve recompiling almost all the Java programs on my system (or at least a whole raft of apache code).

The support for 1.5 isn't all that great. From what I can tell, what needs to happen is that the ebuilds which will have problems with Java 5 need to add '-source 1.4' to the invokation of javac - however in the case of ant scripts this may need the scripts edited before compilation.

Is there another solution to these problems that I've missed? If not it looks like something that really needs to be worked on as there is a good selection of java based stuff in portage, and Gentoo makes a great dev platform and server for Java, but it seems to be lagging behind in terms of support for 1.5.
Back to top
View user's profile Send private message
Syshalt
n00b
n00b


Joined: 26 Sep 2003
Posts: 22

PostPosted: Tue Apr 05, 2005 6:30 pm    Post subject: Reply with quote

There are actually no serious problems with building Ant on JDK 1.5. The only thing that breaks is the Xalan. You can easily disable it via "noxalan" use flag, and it's not gentoo fault - IIRC Xalan does not support JDK 1.5 yet.

The other package that breaks is dev-java/commons-net. But the "~x86" version builds just fine, so add "dev-java/commons-net ~x86" to the /etc/portage/package.keywords and you're all set.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments 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