Results 1 to 2 of 2
  1. #1
    hofsoc is offline Member
    Join Date
    Feb 2009
    Rep Power

    Default Call java Methods from Python Script


    I am trying to call java methods from a python script. Jython is not an option. I have looked at using Jpype. Below is my code thus far:

    from jpype import *

    startJVM("C:\Program Files\Java\jdk1.6.0_12\jre\bin\client", "-ea", "-Djava.class.path=%s" % classpath)
    com =JPackage("CallJavaFromPython")
    jp = com.Jpype1()

    ================================================== =


    package CallJavaFromPython;

    public class Jpype1 {

    public static void main(String args[]){

    public void printArgument(String arg){


    ================================================== =

    Error message i am getting when I try to run the python script is :

    NameError: name 'startJVM' is not defined

    has anyone come across this before?

    Thanks in advance...

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Rep Power

Similar Threads

  1. [B] How to call Perl script from Java [/B]
    By JavaEmpires in forum Advanced Java
    Replies: 7
    Last Post: 12-19-2008, 03:10 PM
  2. Program To Call Random Methods
    By nyamtoko in forum Advanced Java
    Replies: 5
    Last Post: 12-01-2008, 11:49 AM
  3. How to call methods of different classes
    By adeeb in forum New To Java
    Replies: 2
    Last Post: 06-06-2008, 06:08 AM
  4. Replies: 0
    Last Post: 01-02-2008, 01:52 PM
  5. Calling Java methods form Python
    By mew in forum Advanced Java
    Replies: 1
    Last Post: 12-21-2007, 02:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts