May be you should look in System properties:

import java.lang.System as System

I think the jar is there.

2011/8/28 Zhangguangchao <>

No, it doesnít work. Besides, I used the code below, not work, either.

†††††††† systemState.path.remove(new PyString(jarFile.getAbsolutePath()));

†††††††† systemState.path.clear();

There is an important clue that if I use pythoninterpreter instance to execute a piece of python code like this :


then , †the console report the information below:

*sys-package-mgr*: processing modified jar, 'E:\jars\catalina-ant-jmx.jar'

Then I canít delete the file : catalina-ant-jmx.jar.

However, I found that I can delete the jar file without executing any python code.

In a word, I can delete the jar file imported by jython interpreter if I didnít execute any python code with jython interpreter. I canít delete any jar files if I execute any python code because the jar files is modified by something.

Is there anything wrong with the interpreter action when processing the execution of† python code?

From: Pierre Thibault []
Sent: Saturday, August 27, 2011 9:57 PM
Subject: Re: [Jython-users] help for how to stop embeded jython?

2011/8/27 Zhangguangchao <>

Hi, jython experts,
I'm new to jython, and I met a problem that when I embed jython interpreter into my app, I find that after I execute the python script , the jar file which is appended to path of the PysystemState instance of the embedded interpreter can't be deleted.
Here is my usage of adding jar dynamically:
† † † †PySystemState systemState = pythonInterpreter.getSystemState();
† † † †systemState.path.append(new PyString(file.getAbsolutePath()));

Then I use the pythonInterpreter to execute some python code. However, when I wanna stop the jython engine, the jar file can't be deleted. Here is my stop code:
† † † †pythonInterpreter.cleanup();
† † † †pythonInterpreter = null;

Can anyone tell me how to stop the embedded jython properly in order to delete the imported jar ? Thanks a lot.

† † † † † † † † † † † † † † † † † † † †Dominic


systemState.path.remove(new PyString(file.getAbsolutePath()));



My blog and profile (
YouTube page (
Twitter (



My blog and profile (
YouTube page (
Twitter (