Quick Summary to Install Java 1.5 SDK on Debian Testing

  • user warning: Can't open file: 'sessions.MYI'. (errno: 145) query: SELECT COUNT(sid) AS count FROM sessions WHERE timestamp >= 1511417548 AND uid = 0 in /var/www/drupal-5.23/includes/database.mysql.inc on line 174.
  • user warning: Can't open file: 'sessions.MYI'. (errno: 145) query: SELECT DISTINCT u.uid, u.name, s.timestamp FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.timestamp >= 1511417548 AND s.uid > 0 ORDER BY s.timestamp DESC in /var/www/drupal-5.23/includes/database.mysql.inc on line 174.

This is my second Java installation artical for Debian HK .

To help other Debain user to install Java SDK 1.5. in Debian Testing quickly, Here is my summary steps to install Java SDK 1.5. in Debain testing :

1. Make sure that the contrib section is included in your APT sources ( /etc/apt/sources.list ).

Example: (your may differ a bit, but make sure the contrib part is there)

deb http://ftp.hk.debian.org/debian/ testing main contrib non-free

2. Create a directory ( for example : tempfile) to hold the java files,

3. Download Java SDK or run time 1.5 from Sun Website to that directory.

4. Change to that directory

5. apt-get install java-package

6. fakeroot make-jpkg jre-1_5_0_01-linux-i586.bin, then asnwer the questions.

a sun-j2re1.5_1.5.0+update01_i386.deb package will be built in that directory.

7. Su as root, then run : dpkg -i sun-j2re1.5_1.5.0+update01_i386.deb

8. Verify installation


java -version

The output should look something like this if everything is well:
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)

9. Browser Plugin

With Mozilla Firefox from testing/unstable you shouldn't need to do anything as the installation procedure of the Java should have created the symlink properly.

Check the link for Firefox:

ln -s /usr/lib/j2sdk1.5-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla-firefox/plugins/libjavaplugin_oji.so

10 Job Done.

Hope to this quick summary may help those Debian users who want to run Java in Debian.

Kim Man Lau
Date: 16 Feb 2005





由于是Debian,Sun缺省设置的几个RH/suse等都不能用,可以全部将fontconfig.*.properties删除,只留一个 fontconfig.properties,里面把中文字体设好,字体还是核心字体,注意名字和路径即可。

1 .建立目录:$JAVA_HOME/jre/lib/fonts/fallback;
2. cp中文字体到刚才建立的目录中,或者在这个目录中建立到中文字体的连接;
3. 大功告成。
如仍有问题,export JAVA_FONTS=$JAVA_HOME/jre/lib/fonts即可。

Chinese font in Java

Thanks for your comment, Yes, 应该加一个中文字体的设置, But I do not know how to do it.

My objective for this artical is to make the Java installation in Debian :

1. Simple and Easy to use- Just follow the steps, job done.

2. Clear - no others unrelated messages to prevent ambiguity. (i.e. Discussion groups or news group always have a long reply message on the subject but never have a final summary on the solution when they solve the problem).

3. The steps were tested and work.

With this artical, Debian Users no need to search other source from different Debian web sites .

Any one should just follow those steps then can complete the installation of the application (i.e. Java).

This is my primary objective.

Refer to my pervious artical on installation Java on Woody, I took some times to find out the way to install Java on Woody which was not fun.

Linux users always help each other on the news group, But few will summarize on their solution.

I hope my contributtion can help the new users to save time and no need to reinvent the wheel.

I also hope other Debian Users can help to make this artical more usefull and include Java options installation with easy steps. i.e. Chinese fonts.

By the way , Some questions on your reply:

1 .建立目录:$JAVA_HOME/jre/lib/fonts/fallback;

2. cp中文字体到刚才建立的目录中,或者在这个目录中建立到中文字体的连接;

The Jave directory has a fonts directory at :


Do I need to create another new directory or just cp 中文字体 到 /usr/lib/j2sdk1.5-sun/jre/lib/fonts 目录中 ?

What kinds of 中文字体 can work on Java ?

big5, GB or unicode ? Java default support unicode.

On /usr/lib/j2sdk1.5-sun/jre/lib/fonts 目录中 , I saw those are ttf fonts.

Can I just cp Debain Chinese fonts(i.e. ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ) to it ? Will it work ?

I shall update this artical after I test it work.

Looking for your reply.

Kim Man Lau

in OSWikiHK and DebianWiki of Taiwan

I would like to notice every that I had already written a guide about Installing JSDK/JRE in Debian using java-package on OSWikiHK few months ago. Of course, in chinese. Besides, Chinese DebianWiki in Taiwan also have an article about this and included the step of making Java to use chinese fonts.


That's right, the articles can be found at http://wiki.debian.org.hk/w/Category:Java , and they are quite complete and up-to-date.