如何解析异常:jpype.\u jexception.ExceptionPyRaisable:java.lang.Exception:未找到类示例

如何解析异常:jpype.\u jexception.ExceptionPyRaisable:java.lang.Exception:未找到类示例,java,python,Java,Python,Python:2.7-32位, Java:jdk7-32位, JVM路径:C:\ProgramFiles(x86)\Java\jre7\bin\client\JVM.dll Hello.py文件 import jpype jpype.startJVM(jpype.getDefaultJVMPath()) jpype.java.lang.System.out.println("hello world") Ex = jpype.JClass("Example") Exobj = Ex() pri

Python:2.7-32位, Java:jdk7-32位, JVM路径:C:\ProgramFiles(x86)\Java\jre7\bin\client\JVM.dll

Hello.py文件

import jpype
jpype.startJVM(jpype.getDefaultJVMPath())

jpype.java.lang.System.out.println("hello world")

Ex = jpype.JClass("Example")
Exobj = Ex()
print Exobj.addImage()
jpype.shutdownJVM()
public class Example {
    public String addImage() {
        System.out.println("In java file");
    }
}
同一软件包中的Example.java文件

import jpype
jpype.startJVM(jpype.getDefaultJVMPath())

jpype.java.lang.System.out.println("hello world")

Ex = jpype.JClass("Example")
Exobj = Ex()
print Exobj.addImage()
jpype.shutdownJVM()
public class Example {
    public String addImage() {
        System.out.println("In java file");
    }
}
在执行Hello.py-python Hello.py时:输出如下所示

C:\Test>python Hello.py
hello world
Traceback (most recent call last):
  File "C:\Test\hello.py", line 6, in <module>
    Ex = jpype.JClass("Example")
  File "C:\Python27\lib\site-packages\jpype\_jclass.py", line 54, in JClass
    raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.ExceptionPyRaisable: java.lang.Exception: Class Example not found
C:\Test>python Hello.py
你好,世界
回溯(最近一次呼叫最后一次):
文件“C:\Test\hello.py”,第6行,在
Ex=jpype.JClass(“示例”)
文件“C:\Python27\lib\site packages\jpype\\u jclass.py”,jclass中的第54行
raise\u RUNTIMEEXCEPTION.PYEXC(“未找到类%s”%name)
jpype.\u jexception.ExceptionPyRaisable:java.lang.Exception:未找到类示例