Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc



Mandarin Tools's DimSum software is a very useful Java application for reading Chinese characters and much more. It includes a Chinese dictionary, and flash cards for learning Chinese characters.

You can find the home page at

and a discussion forum at

This wiki page describes how to install DimSum on Gentoo Linux. Installation is not quite as simple as one might first expect. Although a straightforward Java application, the software depends on Chinese fonts correctly installed within Java font properties. The latter requirement is not trivial.

There are two ways to install the package, one way by downloading a tarball then manually installing a 3rd-party e-build, another way using layman. Follow sections Download and Installation below for the manual way. Skip to section Using Overlay Manager for the layman way!

As of October 2006, the official release version is 0.7.9. The following instructions apply to this version.


Start by downloading the tarball at this address


Unpack the tarball somewhere using

mybox ~#
tar xjf dimsum-on-gentoo.tar.bz2Image:CursorOFF.gif

You now have a set of files as follows where somewhere corresponds to where you extracted the tarball, i.e. the current directory in the above tar command.

-rw-r--r-- Manifest
-rw-r--r-- mandarintools-dimsum-0.ebuild

-rw-r--r-- digest-mandarintools-dimsum-0
-rwxr-xr-x dimsum
-rw-r--r-- dimsum.desktop
-rw-r--r-- dimsum.png

Now, login as root user and run the following Portage command.

mybox ~#
PORTDIR_OVERLAY=/somewhere/dimsum-on-gentoo/ emerge mandarintools-dimsumImage:CursorOFF.gif

This runs Gentoo's emerge command which downloads and installs the package. Thereafter, you should find DimSum in the Accessories menu. Or you can run the application by simply typing dimsum on the command line.

Using Overlay Manager

You can also use layman. Just add the following URL to layman's configuration at /etc/layman/layman.cfg under the list of overlays.

Sync the overlay

mybox ~#
layman -SImage:CursorOFF.gif

Then add the overlay using

mybox ~#
layman -a royratcliffeImage:CursorOFF.gif

You can now just run

mybox ~#
emerge mandarintools-dimsumImage:CursorOFF.gif

This of course assumes you have set up layman already. See here for instructions on how to set up layman.


What should I do if...

Manifest Mismatches

If you find a problem related to the manifest, run the following then repeat the previous emerge command.

mybox ~#
ebuild /somewhere/dimsum-on-gentoo/dev-java/mandarintools-dimsum/mandarintools-dimsum-0.ebuild digestImage:CursorOFF.gif

This occurs because the JAR has changed since calculating the digest information for version 0.7.9! DimSum's author just overwrites the download URL with the new version, dimsum.jar. The URL carries no version information; it just represents the latest version, whatever that may be! Not ideal but means that you need to re-emerge the package to upgrade to the latest.

Java 1.5 Crashes

You might find that Java crashes when you run DimSum after upgrading to Java 1.5! There a many differences and incompatibilities between Java 1.4 and 1.5 series. DimSum 0.7.9 was compiled using Java 1.4 (Sun's version 1.4.2_03 to be exact) so requires this version or compatible versions to operate normally.

Why Does It Suddenly Stop Working?

If you upgrade your Gentoo system using emerge world -u then you have inadvertently switched away from Java 1.4 when the upgrade changed over to 1.5. In this case, like me, you need to reinstall Java 1.4. Actually, you might find that the old Java 1.4 remains in place but does not appear in the selection options for alternative Java VMs (see below). In this case, you need to upgrade to the later revision of the 1.4 JDK which works with the new eselect java-vm scheme.

Install JDK 1.4

Happily, Gentoo lets you install multiple Java runtimes and compilers. So you can have Java 1.4 and Java 1.5 running on the same system, no problem.

Use equery l -p sun-jdk to list the currently available JDK packages and pick out a 1.4-based version. At time of writing, dev-java/sun-jdk- is the latest 1.4 JDK package on Gentoo. Install it directly using

mybox ~#
emerge =dev-java/sun-jdk-

as root user. Note the equals sign! It identifies a specific package. Of course, the emerge cannot download the package bundle directly because of Sun's licensing for 1.4, so follow the instructions to download the bundle from Sun's website via the URL given. Finally move the j2sdk-1_4_2_12-linux-i586.bin download to the /usr/portage/distfiles directory. Re-run the emerge above. It now installs.

Selecting Your Java VM

Final step: tell Gentoo which Java VM to use. You list the available VMs using eselect java-vm list. This command lists the available VMs and which VM is the current system VM and which one is the current user VM. Easiest thing is to set the system-vm using

mybox ~#
eselect java-vm set system sun-jdk-1.4Image:CursorOFF.gif

but you can also set up 1.4 JDK just for your own user account by changing system to user in the above command. Setting the system VM requires root permissions, user VM does not.

My Chinese Fonts Disappear!

Final note, you may experience problems with DimSum's fonts after following the instructions above.

This happens because the font properties do not appear in the right place. The dimsum package inserts in the Java JDK library subdirectory. It is therefore important to emerge the mandarintools-dimsum package after selecting the appropriate Java VM for 1.4; otherwise, font properties are sent to the wrong place and the fonts disappear. So eselect the 1.4 VM first then run emerge.

In summary, when merging the DimSum package, make sure that you have the right Java VM selected!

Why Oh Why?

At present, during change between 1.4 and 1.5, Java set-up gets rather messy.


Got problems? Let me know! You can contact me at roy DOT ratcliffe AT gmail DOT com, or better still, start a discussion by following the link below (let others benefit too).

Concerns or Compliments? Please use the Discussion section.

Retrieved from ""

Last modified: Fri, 05 Sep 2008 06:19:00 +0000 Hits: 8,346