HOWTO mandarintools dimsum
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Contents |
[edit] Introduction
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
http://www.mandarintools.com/dimsum.html
and a discussion forum at
http://www.chinesecomputing.com/phpBB2/viewforum.php?f=1
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.
[edit] Download
Start by downloading the tarball at this address
http://www.roy.ratcliffe.dsl.pipex.com/gentoo/dimsum-on-gentoo.tar.bz2
[edit] Installation
Unpack the tarball somewhere using
|
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.
/somewhere/dimsum-on-gentoo/dev-java/mandarintools-dimsum: -rw-r--r-- Manifest -rw-r--r-- mandarintools-dimsum-0.ebuild /somewhere/dimsum-on-gentoo/dev-java/mandarintools-dimsum/files: -rw-r--r-- digest-mandarintools-dimsum-0 -rwxr-xr-x dimsum -rw-r--r-- dimsum.desktop -rw-r--r-- dimsum.png -rw-r--r-- font.properties.zh
Now, login as root user and run the following Portage command.
|
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.
[edit] 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.
http://www.roy.ratcliffe.dsl.pipex.com/gentoo/layman.xml
Sync the overlay
|
Then add the overlay using
|
You can now just run
|
This of course assumes you have set up layman already. See here for instructions on how to set up layman.
[edit] Troubleshooting
What should I do if...
[edit] Manifest Mismatches
If you find a problem related to the manifest, run the following then repeat the previous emerge command.
|
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.
[edit] 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.
[edit] 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.
[edit] 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-1.4.2.12-r2 is the latest 1.4 JDK package on Gentoo. Install it directly using
|
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.
[edit] 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
|
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.
[edit] 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 font.properties.zh.os.version 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!
[edit] Why Oh Why?
At present, during change between 1.4 and 1.5, Java set-up gets rather messy.
[edit] Feedback
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.
