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:

$ emerge blackdown-jdk eclipse-sdk

if you want to install the sun's version of the jdk, instead of blackdown jdk, you can get the 1.4.2 version of it using:

$ emerge sun-jdk java-sdk-docs

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:

$ emerge sun-jdk java-sdk-docs

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- X alsa browserplugin doc examples jce mozilla nsplugin

this also installs the documentation and the examples. 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 package. 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:

$ emerge eclipse-cdt

here is more information on installing java 1.5 and eclipse 3.x on Gentoo OS.



  1. browe said

    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.

  2. 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:

    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.

  3. […] my previous post discussed the installation of Java on a Gentoo system. its all well as long as you want to run the default supported version of java on the Gentoo system – you install blackdown-jdk 1.4, Eclipse 3.0, and maybe Eclipse CDT too. but if you want to install java 1.5(Tiger), then you need to unmask the package and remember to make blackdown(or sun) jdk 1.4 as the default JVM for the system. you can keep sun jdk 1.5 as the default JVM for the user. the procedure is like this: […]

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: