View previous topic :: View next topic |
Author |
Message |
NZLemming n00b

Joined: 03 Apr 2005 Posts: 28 Location: Madrid, Spain
|
Posted: Tue Apr 05, 2005 3:33 pm Post subject: Java 5 |
|
|
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 |
|
 |
sunilgeo n00b

Joined: 29 Jan 2005 Posts: 74
|
Posted: Tue Apr 05, 2005 3:39 pm Post subject: |
|
|
Try ACCEPT_KEYWORDS="~x86" emerge java |
|
Back to top |
|
 |
abcdefg Apprentice

Joined: 29 Feb 2004 Posts: 216 Location: The Netherlands
|
Posted: Tue Apr 05, 2005 3:44 pm Post subject: |
|
|
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 |
|
 |
Voltago Advocate


Joined: 02 Sep 2003 Posts: 2593 Location: userland
|
Posted: Tue Apr 05, 2005 3:46 pm Post subject: |
|
|
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 |
|
 |
abcdefg Apprentice

Joined: 29 Feb 2004 Posts: 216 Location: The Netherlands
|
Posted: Tue Apr 05, 2005 3:48 pm Post subject: |
|
|
Voltage, you were too fast for me  |
|
Back to top |
|
 |
NZLemming n00b

Joined: 03 Apr 2005 Posts: 28 Location: Madrid, Spain
|
Posted: Tue Apr 05, 2005 4:11 pm Post subject: |
|
|
Fantastic! Thanks guys, I'll try it when I get home.
This community is great! |
|
Back to top |
|
 |
db_404 Guru

Joined: 05 Dec 2002 Posts: 336
|
Posted: Tue Apr 05, 2005 6:13 pm Post subject: |
|
|
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 |
|
 |
Syshalt n00b


Joined: 26 Sep 2003 Posts: 22
|
Posted: Tue Apr 05, 2005 6:30 pm Post subject: |
|
|
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 |
|
 |
|