JGloss is a Java application. To run it, you will need a Java implementation that conforms to the Java 2 Version 1.3 or 1.4 specifications, e. g. Sun's Java Runtime Environment 1.4 (JRE). Make sure that you install the international version.
Your computer system should already be configured to work with Japanese text. You must have a Japanese font installed. Having a Japanese input method installed is not absolutely necessary, but very useful. As a test, if your web browser can display Japanese text, it should be possible to set up Java do do the same. See also the Section called Making Java work with Japanese text.
To use JGloss, you will need some dictionaries. Currently supported dictionary formats are:
EDICT dictionaries are Japanese to English word dictionaries. You can download them from the Monash Nihongo FTP Archive. Each dictionary also needs a JJDX index file. If no index file is found, it will be created automatically by JGloss and saved in the dictionary directory. Should the index file creation fail, for example because the directory is write-protected, the dictionary can't be used and an error message is displayed.
The WadokuJiten is an extensive Japanese-German dictionary. To use it, download the file WadokuJT.zip from this page, unzip it and add the resulting file WadokuJT.txt to the list of dictionaries used by JGloss in the dictionary dialog.
The WadokuJT dictionary format is only supported if you have Java Version 1.4 installed, otherwise JGloss will display a "not a dictionary file" error dialog. The WadokuJT dictionary is also available converted to EDICT format from the same location. The EDICT format however does not support umlauts and the more detailed entry format of WadokuJT.
WadokuJT dictionaries need a JJDX index file. If no index file is found, it will be created automatically by JGloss and saved in the dictionary directory. Should the index file creation fail, for example because the directory is write-protected, the dictionary can't be used and an error message is displayed.
KANJIDIC dictionaries store information about individual kanji, among other things readings and translations. You can find KANJIDIC dictionaries at the same location as the EDICT dictionaries.
The SKK dictionaries provide a mapping from readings to words (no translations). They are usually used by Japanese input methods, but JGloss can use them to look up readings for kanji words.
JGloss requires no installation. On a Windows system with the Java Runtime Environment installed, double-clicking the jgloss.jar file should start the application. To start JGloss from a shell, change to the directory which contains the JAR file and enter java -jar jgloss.jar. JGloss has some command line options: java -jar jgloss.jar [option] file ....
Options
Shows a short help message with the list of options.
Creates JJDX index files for the dictionary files given on the command line. The index files will be saved in the current directory. JGloss tries to create a JJDX index file for a dictionary file automatically when none is found. If this fails, for example because a normal user has no write permissions for the dictionary directory, you can log in as a privileged user (e. g. administrator or root) and use this option to create the index files.
Prints the format of the dictionary files given on the command line.
Annotate a HTML file with dictionary entries for Japanese words. JavaScript will be used to display the results in a browser. The HTML generation is currenty only written for Mozilla, results with other browsers may vary. The parameter format is -a [in [out]]. If in or out are left out or are set to '-' stdin/stdout will be used.
If Japanese is set as your computer system's default language, JGloss should work without any further setup. If not, you should at least have a Japanese font installed. A Japanese input method, while not required, should also be installed. If you are using Sun's Java Runtime Environment for Windows, make sure that you have the international version installed (the smaller download only has English locale settings).
On Windows and MacOS X systems no font configuration should be neccessary. The first time JGloss is run, it tries to determine which font to use for displaying Japanese characters. If the Java default fonts don't contain Japanese characters, it tests if one of the fonts Arial Unicode MS, MS UI Gothic, MS Mincho, MS Gothic or Osaka is available and configures itself to use it. If none of the fonts work, no configuration is done and the default settings are kept. In this case Japanese characters will not display correctly. Read the Section called Style in Chapter 3 for information on how to select fonts manually, or read on for information on how to change the Java default fonts.
Ths following paragraphs describe how to change the Java default font settings to use Japanese fonts. The descriptions apply to Sun's Java Runtime, other implementations may differ. Following these instructions should not be neccessary on Windows and MacOS X Systems since a custom font can be used, but have to be used on X11 Systems (blame the X font handling for that).
The easiest way to get Java to use Japanese fonts is to set the user.language parameter to ja: start JGloss as java -Duser.language=ja -jar jgloss.jar. This will make Java read the font definition from the font.properties.ja file of the JVM installation, and only works if the fonts used in the file are available. Unfortunately, at least on my Linux box, this will not make Java use the Japanese input method. On Unix systems, a second way is to set the LANG environment variable to ja_JP in a shell and then run JGloss from that shell. This will also make Java recognize an installed Japanese input method.
An alternative method, and one that allows more customization of what fonts to use, is to edit the font.properties files. The font.properties files are stored in the lib folder in the install directory of the Java Runtime Environment. They contain the definition of the default fonts used in Java dialogs and input elements. Which of the font.properties is used depends on the locale setting of the operating system, e. g. if you are running in a Japanese environment, the file font.properties.ja will be used. If there is no matching file for the current locale, the font.properties file is used. This is the case for most western locales. The file contains no definition for Japanese fonts, but you can edit it and add these fonts. The easiest way to do this is to simply rename the file font.properties.ja to font.properties (but make a backup of the original file first). You can also edit the file to make it use different fonts.
On Windows 2000 and XP, the JRE supports the Japanese input method regardless of the system language settings, but you will have to use one of the methods mentioned above to get Java to use Japanese fonts. I had no luck so far in getting the JRE to use the input method under Windows 98.
Copying Japanese text between JGloss and other applications on X11 systems only works if JGloss is running in a Japanese environment. To achieve this, open a shell, set the environment variable LANG to ja_JP and start JGloss from that shell. Under MacOSX, copying Japanese text is problematic as well. To get copy and paste working properly, move nihongo to the first position in the Language tab of the System preference->International panel.
The font.properties.ja file of the Linux version of Java is configured for fonts contained in the Japanese distribution of Red Hat 6.1 (and the international Red Hat 7.x with Japanese support installed). It seems that these fonts (wadalab-gothic.ttf and watanabe-mincho.ttf) are not contained in most other Linux distributions. To make matters worse, Java only seems to accept TrueType fonts and not the Japanese bitmap fonts commonly installed with X11. This means that you will either have to install the mentioned TrueType fonts or edit the properties file to use a different already installed Japanese TrueType font.
This section describes how to build JGloss from the sources. You do not need to read it if you just want to use JGloss and have downloaded the binary release (no -src ending).
To build the JGloss JAR file, you have to have the Java Development Kit 1.4 from Sun (or something compatible) installed. To create the documentation files from jgloss.docbook you need the DocBook 4.1 DTD and various DocBook tools. Look for them at the OASIS site, Norman Walsh's site and the DocBook tools page, or on your favorite Linux distribution's CD-ROMs.
The sources come with a Makefile which automates the build process. The Makefile is written for a GNU/Linux system, but should work on other systems with the GNU tools or equivalent commands installed. Here is an (incomplete) list of make targets:
Creates the JGloss JAR archive. This is the default make target.
Builds the JGloss-WWW servlet. The components will be placed in the jgloss-www directory. This is an experimental servlet which rewrites Japanese web pages. Words in the page are looked up in the dictionaries and annotated with the lookup results. JavaScript is used to display the result in the browser. You can find documentation for the servlet in src/www/index.html.
Generates the documentation files from doc.src/jgloss.docbook
Generates the javadoc documentation for the JGloss source files.
Creates the source and binary distribution zip and tgz files.
If you can't use the Makefile, you can build the JGloss JAR archive by hand. Use javac to compile the *.java files in the src directory. Use native2ascii to convert every .properties.in file in the src/resources directory to a .properties file using the ASCII charset. The native charset of the file is specified in the first line of the input file. Then use jar to build a JAR archive, using the MANIFEST.MF file as manifest (see jar options). Make sure that the resources and data directories are included in the archive.