>I want to use jython to interactively test some Java work I did.
>Unfortunately for this situation, jython caches all jar information
>and skips any jar that is corrupt. My Java work consists of storing
>some information (license key) in a jar in the CLASSPATH. Of course,
>doing this (in the only way I could come up with) causes that
>particular file to be "corrupt" because it no longer matches the CRC
>checksum or the compression algorithm. This is acceptable because
>this file is never loaded by the JVM, but read directly by my code.
>When I want to test it with Jython, jython doesn't load the jar
>because it is "bad". As a result I don't get any of the classes that
>are defined in the jar.
Just to clear up possible confusion: Jython doesn't load anything from
jars on CLASSPATH. Instead it uses the java mechanism for loading
classes and resources from such jars. Jython only scans the jars to
detect java packages (and support import *).
If you don't need this scanning, you can manually tell jython which java
packages you have:
>Is there a way to turn off jython's processing and caching of the
>jar's information so I can use this modified (err, hacked <wink>) jar?
>If not, I can write some Java code to run through some tests.
Have you checked if the JVM will load classes from such a corrupt jar? I
wouldn't be too surprised if some JVMs will ignore a corrupt jar.
I can't think of a way to achieve your goal without resorting to a file.