hi Soha,
I did like this. If you find a better way please share it.
1- Explode the jython jar: get the jython standalone jar, change the
.jar to .zip, unzip it into a folder. Inside that unzipped folder
you will find a subfolder Lib.
2- Copy that folder Lib into your eclipse project.
3- In you java code, when you initialize jython, point to that Lib folder
as python.home, for example:
Properties props = new Properties();
props.put("python.home","path to the Lib folder");
props.put("python.console.encoding", "UTF-8"); // Used to prevent: console: Failed to install '': java.nio.charset.UnsupportedCharsetException: cp0.
props.put("python.security.respectJavaAccessibility", "false"); //don't respect java accessibility, so that we can access protected members on subclasses
props.put("python.import.site","false");
Properties preprops = System.getProperties();
PythonInterpreter.initialize(preprops, props, new String[0]);
PythonInterpreter interp = new PythonInterpreter();
That's it! now it should work!