Unresolved import org.python / working with jython and java?
I'm using Eclipse and I"m trying to create a java program that can run my python code. I'm following the guidelines on this page: http://jythonpodcast.hostjava.net/jythonbook/en/1.0/JythonAndJavaIntegration.html#using-jython-within-java-applications
But wh开发者_JAVA技巧en I include these statements at the top:
package org.jython.book.util;
import org.python.core.PyObject;
import org.python.core.PyString;
import org.python.util.PythonInterpreter;
I receive a message saying "The import org.python cannot be resolved." Any suggestions on how to fix this?
Thank you so much!!
- In the Package Explorer (on the left), right click on your Java project and select Properties.
- In the treeview on the left, select Java Build Path.
- Select the Libraries tab.
- Select Add External JARs...
- Browse to your Jython installation (C:\jython2.5.2 for me), and select jython.jar. Click OK.
- Click OK.
精彩评论