old version (specially one that comes with websphere 6) of jython doesnt care about -Dpython.cachedir variable and still try to use python.cachedir from registry file — finding registry file is done as following
Finding the Registry File
The following steps are used to find the Jython registry file, and also to set the Python values for sys.prefix. First a root directory is calculated:
* If there is a property called python.home, this is used as the root directory.
* Otherwise, the property install.root is used if it exists.
* If neither of those properties exist, then Jython searches for the file “jython.jar” on the Java classpath, as defined in the system property java.class.path. The actual file system isn’t searched, only the paths defined on the classpath (one of them must literally include “jython.jar”).
Once the root directory is found, sys.prefix and sys.exec_prefix are set to this, and sys.path has rootdir/Lib appended to it. The registry file used is then rootdir/registry.
that means if your jython.jar is in websphere optionalLibraries/jython directory then jython will try to write cache on optionalLibraries/jython/cachedir and you might not have write permission on this directory, and you will wonder I’m telling jython to write cache on -Dpython.cachedir=~/tmp/jy_cache but why cant it write there, I’ve write permission to this directory.
That what I did to resolve it, copy jython.jar and registry file from wehsphere optionalLibraries/jython in your home and then cachedir will we created in the same dir jython.jar is, I think in later versions jython respect the -Dpython.cachedir to get directory to write cache on.