Installing java-gnome on Gentoo Linux
Downloading, building, and installing java-gnome on Gentoo is simple and fast. Of course it is. It's Gentoo!
The following command should install the latest released version of the bindings library:
# emerge >=dev-java/java-gnome-4.0
Use latest release!
java-gnome is a rapidly moving project, and each release immediately
obsoletes the proceeding one. There is no reason to use anything other than the
latest release; we encourage you to use the package in ~arch
as
soon as a newer one is available.
Thus it's probably a good idea to either add:
>=dev-java/java-gnome-4.0 ~x86to
/etc/portage/package.keywords
, or to use
ACCEPT_KEYWORDS
on the emerge command line, for
example:
# ACCEPT_KEYWORDS=~x86 emerge java-gnomeThe Gentoo
.ebuild
can be accessed from the dev-java/java-gnome
page in case you're curious.
Getting variables from java-config
Somewhat unusually for Gentoo, there is a strict policy in place defining
the installed locations of Java libraries. Therefore you'll want to use the
java-config
tool as a helper to find the java-gnome
.jar
. For example:
$ java-config -l java-gnome-4.0 /usr/share/java-gnome-4.0/lib/gtk-4.0.jarThis implies that the prototypical command line to run java-gnome programs on Gentoo will look something like:
$ java -client \ -classpath `java-config -l java-gnome-4.0` \ package.ClassNamewhich should resolve to something like:
$ java -client \ -classpath /usr/share/java-gnome-4.0/lib/gtk-4.0.jar \ package.ClassNameEither will work.