Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PythonInterpreter.initialize

Status
Not open for further replies.

kdgOrdinaDenkart

Programmer
Feb 6, 2004
1
BE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top