Search Results

Search found 2 results on 1 pages for 'jchao'.

Page 1/1 | 1 

  • how to import Java class with Python using Eclipse?

    - by JChao
    Hi, I'm trying to write Jython where the Python file imports classes from Java I'm using Eclipse with PyDev. My Python code looks like: 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'm getting the error ImportError: No module named eclipsejavatest The Python project references the Java project. I've tried exporting the Java project and adding the .jar to the Jython Class Path for the Python project. I'm not sure what to do to get this to work.

    Read the article

  • jEdit+JythonInterpreter: how to import java class?

    - by JChao
    Hi, I'm running jEdit with the JythonInterprete and I have a .jar file called JavaTest.jar. JavaTest has a class called SampleJavaClass which has a method printerCount. From my .py file, I want to do: from javatest import SampleJavaClass class SampleClass(SampleJavaClass): def pymain(self): SampleJavaClass.printerCount(4) Java code: package javatest; public class SampleJavaClass { public static void printerCount(int i){ for(int j=0; j< i; j++){ System.out.println("hello world"); } } (etc...) In the JythonInterpreter, I have already tried clicking "Edit Jython Path" and adding the .jar file then running the interpreter again, but it still gives me ImportError: cannot import name SampleJavaClass

    Read the article

1