从python访问JVM

import boilerpipe
Traceback (most recent call last):
File "", line 1, in
File "C:\Anaconda\lib\site-packages\boilerpipe_init_.py", line 10, in
jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.class.path=%s" % os.pathsep.join(jars))
File "C:\Anaconda\lib\site-packages\jpype_core.py", line 50, in startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unable to load DLL [C:\Program Files\Java\jre7\bin\client\jvm.dll], error = The specified module could not be found.
at native\common\include\jp_platform_win32.h:58
尝试过: 重新安装jvm

import ctypes
import os
os.chdir(r"")
ctypes.CDLL("jvm.dll")
Still unable to fix
编辑: 尝试了下面的代码,仍然无法执行:

from py4j.java_gateway import JavaGateway gateway = JavaGateway() 它给出了与以前相同的错误。

上一篇:JPype将args传递给Java


下一篇:Python 如何正确调用 jar 包加密,得到加密值?