Subject: sun-jre15 works with mozilla-1.7.6 on NetBSD-2.0/i386
To: None <>
From: BSD For Ever <bsd4ever@nospam.lan>
List: netbsd-java
Date: 03/28/2005 23:23:15
Hi folks,

If you have NetBSD-2.0 for i386 and want to add Java support to your native build of mozilla-1.7.6, follow these simple steps and you will be running applets in less then 5 minutes (or more if you haven't built mozilla yet):

First install from pkgsrc the following packages (newer releases should also work) if you haven't already done it :
mozilla-1.7.6 (www/mozilla)
suse_base-9.1nb5 (emulators/suse_base)
suse_compat-9.1 (emulators/suse_compat)
suse_x11-9.1nb1 (emulators/suse_x11)
sun-jre15-5.0.2 (lang/sun-jre15)

Then issue the following commands (the "$" prompt indicates any user can do it, "#" indicates commands that should be run by root) :
$ cat >/tmp/javaglue15.c <<EOF
#include <stdio.h>
#include <errno.h>
#undef stdin
#undef stdout
#undef stderr
FILE *stdin=&__sF[0], *stdout=&__sF[1], *stderr=&__sF[2];
int *__errno_location(void) { return __errno(); }
$ /usr/bin/gcc -o /tmp/ -shared /tmp/javaglue15.c
# mkdir -p /usr/local/lib
# cp /tmp/ /usr/local/lib
# cp -p /etc/ /etc/
# cat >>/etc/ <<EOF machdep.fpu_present 0:/usr/X11R6/lib/ machdep.fpu_present 1:/usr/X11R6/lib/ machdep.fpu_present 0:/usr/lib/ machdep.fpu_present 1:/usr/lib/ machdep.fpu_present 0:/usr/lib/,/usr/local/lib/ machdep.fpu_present 1:/usr/lib/,/usr/local/lib/
# ldconfig
# cd /usr/pkg/lib/mozilla/plugins
# ln -s ../../../java/sun-1.5/plugin/i386/ns7/

Make sure that the maximum data segment size assigned to your user is at least 262144. This can be done by adding the following line:
ulimit -S -d 262144
to /etc/profile for sh, ksh, and bash users, and by adding the following line:
limit datasize 262144
to /etc/csh.login for csh and tcsh users.

You may also wish to set JAVA_HOME to /usr/pkg/java/sun-1.5 and add $JAVA_HOME/bin to your PATH, but it seems this is not required if you just want to run applets.

That's it. BTW, it works with mozilla-1.7.6 but not (yet) with firefox.

Among the applets I found at the following work ok:

These fail at initialisation:

And this one crashes a couple of seconds after it starts:

Oh, I don't know Linux enough to tell if errno codes are the same as in NetBSD. If this is not the case then __errno_location should probably be adapted.

Off topic: If you haven't visited yet, please do so before it's too late.

Off topic again: If you want to declare your income in France, here are the steps :
1) Install the Linux binary distribution of mozilla because Sun's Java HotSpot(TM) Client VM 1.5.0_02-b09 crashes with some applets when run from a NetBSD-native mozilla.
To install mozilla-linux (www/mozilla-bin) you can put "MOZ_PLATFORM=linux" in /etc/mk.conf.
2) wget
"rmd160 teleir_cryptolib.jar" should yeld:
RMD160 (teleir_cryptolib.jar) = 075747651fd4a2279575e776362a081720d7065f
and "ls -lT teleir_cryptolib.jar" should yeld:
-r--r--r--  1 root  wheel  331391 Oct 22 11:22:24 2004 teleir_cryptolib.jar
3) Put teleir_cryptolib.jar in $JAVA_HOME/lib/ext
4) export LANG=en_US.ISO-8859-1 (othewise the step were you sign your declaration will fail...)
Do *not* install appletPKIN6.jar, check.jar nor Scroll.jar.
Also remember: Removing your ~/.java directory often solves problems like corrupted settings.


BSD for Ever