If you're deploying in a war, then stick the Lib directory in the "classes"
dir (for example), and then point the python path at that directory with
something vaguely like:
Properties props = new Properties();
String jythonPath = libDir.getFile().getCanonicalPath();
PythonInterpreter.initialize(System.getProperties(), props, null);
In my case, "libDir" is a prop injected by spring:
<property name="libDir" value="classpath:Lib" />
So you'll need to grab the canonical path according to whatever framework you're working within.
Dunno if that helps?
I unzipped the jython package and I can run the jython jar using java –jar jython.jar. The interpreter works fine.
What the instructions lack is how to copy the jython jar and resources elsewhere. I don’t want to ship the entire jython zip file with my project; I want to place the relevant parts into a war file.
The #!/usr/bin/python is irrelevant – it’s there because the script has it, but it still doesn’t work without it.
The answer seems to lie in the lib directory – could you tell me how Jython loads resources from it?
This e-mail (including any attachments) is confidential, may containproprietary or privileged information and is intended for the namedrecipient(s) only. Unintended recipients are prohibited from taking actionon the basis of information in this e-mail and must delete all copies.Nomura will not accept responsibility or liability for the accuracy orcompleteness of, or the presence of any virus or disabling code in, thise-mail. If verification is sought please request a hard copy. Any referenceto the terms of executed transactions should be treated as preliminary onlyand subject to formal written confirmation by Nomura. Nomura reserves theright to monitor e-mail communications through its networks (in accordancewith applicable laws). No confidentiality or privilege is waived or lost byNomura by any mistransmission of this e-mail. Any reference to "Nomura" isa reference to any entity in the Nomura Holdings, Inc. group. Please readour Electronic Communications Legal Notice which forms part of this e-mail:
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
Jython-users mailing list