#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    2
    Rep Power
    0

    PythonInterpreter.initialize


    Hello,

    We're working on a project using Java and Python. While executing PyInterpreter.initialize() we encountered some problems.
    The code we are using looks like this:

    import java.util.*;
    import org.python.util.*;
    import org.python.core.*;

    public class SimpleEmbedded {
    public static void main(String []args) throws PyException {
    PythonInterpreter interp;

    Properties props=new Properties();
    props.setProperty("python.path","/home/kdg/jython-2.1/Lib");
    PythonInterpreter.initialize(System.getProperties(),props,args);
    interp = new PythonInterpreter();
    }
    }

    This code generates the following error-message:
    Exception in thread "main" java.lang.NullPointerException
    at org.python.core.PyJavaClass.lookup(PyJavaClass.java:43)
    at org.python.core.PyObject.<init>(PyObject.java:46)
    at org.python.core.PySingleton.<init>(PySingleton.java:8)
    at org.python.core.PyNone.<init>(PyNone.java:10)
    at org.python.core.PySystemState.initStaticFields(PySystemState.java:396)
    at org.python.core.PySystemState.initialize(PySystemState.java:375)
    at org.python.core.PySystemState.initialize(PySystemState.java:348)
    at org.python.util.PythonInterpreter.initialize(PythonInterpreter.java:40)
    at SimpleEmbedded.main(SimpleEmbedded.java:16)

    Can anyone help us ?
    Thanks,

    Ann Carpentier
    Kenny Mees
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    by Java and Python do you mean Jython? You might have more luck in the Java forum with this one even if you are working with Pythons Core i dout many people here (me included) are qualifide to answer your question

    If you like i can try moveing your thread for you?

    Mark.
    programming language development: www.netytan.com Hula

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    2
    Rep Power
    0

    move message


    Indeed, we do mean Jython.

    Can you please move our thread to the appropriate location?

    Thanks
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Ok i've moves the tread to the Java forum, but there IS still a pointer to this thread in the Python forum so anyone who might be able to help can still see it!

    Good luck with the project,

    Mark.
    programming language development: www.netytan.com Hula

  8. #5
  9. Prom night: 1973
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Dec 2001
    Posts
    1,156
    Rep Power
    24
    I've never used Jython, but this post suggests you make sure jython.jar is included in your classpath.
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Jython is an implementation of the Python programming language in pure Java... mmmm ok... not gonna mean anything to most of you since well you're into Java not python but..
    Sean McGrath, CTO, Propylon
    Jython, lest you do not know of it, is the most compelling weapon the Java platform has for its survival into the 21st century:-)
    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo