I am trying to write Jython where a Python file imports classes from Java. I am using Eclipse with PyDev.
My Python code looks like this:
from eclipsejavatest import eclipseJavaTest
from eclipsejavatest import JavaClass
class eclipsePyPrint(eclipseJavaTest):
def eclipsepyMain(self):
print "python main method"
eclipseJavaTest.printerCount(4)
print eclipseJavaTest.gotoPython()
eclipseJavaTest.printerSentence()
samplepyClass = JavaClass("Jython plain")
samplepyClass.setName("jython fancy")
print samplepyClass.getName()
but i get an error ImportError: No module named eclipsejavatest
The Python project refers to the Java project. I tried to export a Java project and add .jar to the Jython class path for the Python project.
I'm not sure what to do to make this work.
Jchao source
share