Message10150

Author otto_fajardo
Recipients Soha, otto_fajardo
Date 2015-07-12.07:41:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436686881.31.0.342393163624.issue2355@psf.upfronthosting.co.za>
In-reply-to
Content
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!
History
Date User Action Args
2015-07-12 07:41:21otto_fajardosetmessageid: <1436686881.31.0.342393163624.issue2355@psf.upfronthosting.co.za>
2015-07-12 07:41:21otto_fajardosetrecipients: + otto_fajardo, Soha
2015-07-12 07:41:21otto_fajardolinkissue2355 messages
2015-07-12 07:41:20otto_fajardocreate