Java on Gentoo
The simplest way to get started with Java development in Gentoo is to install the Blackdown JDK-1.4.2 along with the Eclipse IDE:
If you want to install the sun’s version of the jdk instead of the blackdown jdk, you can get the 1.4.2 version of it using:
To install the 1.5 version of the jdk, you need to unmask it first. Add the following two lines to your /etc/portage/package.keywords file:
>=dev-java/sun-jdk-1.5.0 ~x86
>=dev-java/java-sdk-docs-1.5.0 ~x86
Now do the emerge:
You can also install both of these versions at the same time, and then make one of them as the default jdk. If you need java support in other applications too(like web browser etc), then make sure to add the relevant keywords in the /etc/portage/package.use file:
=dev-java/sun-jdk-1.4.2.10-r2 X alsa browserplugin doc examples jce mozilla nsplugin
This also installs the documentation and the examples – remove these words if you don’t to install them. Also change the version number if you are installing the 1.5 version of the jdk.
If you want to use Eclipse IDE to create C++ programs, you need the eclipse-cdt plugin. First unmask it by placing the following line in /etc/portage/package.keywords file:
>=dev-util/eclipse-cdt-2.0 ~x86
Now do the emerge:
More information on installing java 1.5 and eclipse 3.x on Gentoo OS.
2 comments
if you have done this:
$ emerge blackdown-jdk eclipse-sdk
Eclipse should already be configured to use the blackdown-jdk. if there is no JRE configured in Eclipse for some reason, you can add one by yourself; instructions on how to do it are here:
http://tabreziqbal.wordpress.com/2006/04/01/java-15-and-eclipse-in-gentoo-part-ii/
look for the second paragraph from the bottom of the post.
though it is for adding sun-jdk-1.5 JRE, the procedure is the same to add blackdown-jdk JRE too. let me know if that helps.
When I installed these everything worked fine. Tomcat runs fine with blackdown. Eclipse says no java by default. not sure why. I used java-config to set blackdown as my default system jvm.
Probably need a little more setup instructions than this.