Message10150
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! |
|
Date |
User |
Action |
Args |
2015-07-12 07:41:21 | otto_fajardo | set | messageid: <1436686881.31.0.342393163624.issue2355@psf.upfronthosting.co.za> |
2015-07-12 07:41:21 | otto_fajardo | set | recipients:
+ otto_fajardo, Soha |
2015-07-12 07:41:21 | otto_fajardo | link | issue2355 messages |
2015-07-12 07:41:20 | otto_fajardo | create | |
|