Hi Johan,
I wonder what the right way of building the classpath from a list of packages is? I see that there are symlinks in /usr/share/java/ and it seems I have to hardcode paths to these?
please have a look at the debian-java mailing list archives. You'll see that the classpath topic has been discussed several times already.
There is a javahelper package that does help to generate the classpath (while not doing it in a completely automated way). Make sure that you have read mailing list entries mentioning javahelper and the javahelper documentation before trying your own solution.
Jerico.