I've searched the documentation and the list archives as well as I could and though I've seen somewhat similar queries I haven't found any solutions yet.

I'm developing a Java application that needs to be easily distributable and doesn't require anything installed on the host system except Java 1.5 or newer.  The Jython interpreter is embedded and used to validate and test Jython code that the user can enter through the swing interface.  It works great right up until the user tries something like:

import string
import re

Of course the issue is that when Jython is installed it know where the Lib directory is, but installing the Jython distribution on any of the host machines is not an option (in fact this app will almost certainly only be able to run as an applet or webstart).

I've tried tricks like jarring up the Lib/ directory and adding it to the classpath which I should have guessed won't automagically work.  In the Jython API the PathPackageManager looks promising, but I admit that I can't figure out how it ties into the interpreter.  It also appears that python.path can help me out, but I don't think that just including the Lib dir and all those files is a very good solution (maybe not even possible with webstart and applet).

I don't mind interrogating a jar file containing all of the necessary source and fiddling with JarEntries and that fun stuff if there's a way that I can get access to the Jython standard imports in a Jar file.  I'm just hoping someone's either done it before or can point me in the right direction in the API docs.  It seems to me, also, that being able to distribute the Lib stuff in a jar would make a lot of people's lives easier.