6

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 when 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!!

1
  • Are you sure you added the Jython.jar to your libraries in the eclipse project's properties (Java Build Path/Libraires)? Commented Jun 1, 2011 at 11:13

1 Answer 1

9
  1. In the Package Explorer (on the left), right click on your Java project and select Properties.
  2. In the treeview on the left, select Java Build Path.
  3. Select the Libraries tab.
  4. Select Add External JARs...
  5. Browse to your Jython installation (C:\jython2.5.2 for me), and select jython.jar. Click OK.
  6. Click OK.
Sign up to request clarification or add additional context in comments.

1 Comment

I added jython-standalone-2.5.3.jar, but still cannot import org.python.util.PythonInterpreter.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.