jython and java application
MRAB
python at mrabarnett.plus.com
Wed Nov 25 20:54:43 EST 2009
KB wrote:
> Hi there,
>
> Apologies if this is on the wrong group, this is a jython question.
> Please redirect me to the correct group if this is in error.
>
> I have a java application that takes no arguements. When I run it, it
> spits out output, and finishes.
>
> I am trying to run this java application from jython 2.5.1, JRE6.
>
> I have made simple "Hello World" java classes be callable from a
> simple jython script, yet I am stumbling on the java main construct in
> the application.
>
> print krbtest.SimpleHistoricTutorial().main() obviously gives me an
> args error (expected 1, got 0) as the definition in the java
> application is:
>
> public static void main(String[] args)
>
> The jython code is as follows:
> import krbtest
>
> # was messing with this to pass a java formatted string but to no
> avail
>
> from java.lang import String
>
> print krbtest.SimpleHistoricTutorial().main()
>
> #####
>
> Any advice greatly appreciated! Especially with how to call "main()"
> with arguments from jython.
>
> Apologies in advance again if this is the wrong group.
I don't know jython, but from the look of it I'd say that you need to
give main() some kind of argument, such as a string or an empty list.
(If you pass an empty jython list to a Java method that's expecting an
array of String, will the Java method receive a zero-length array of
String?).
More information about the Python-list
mailing list