编程语言
首页 > 编程语言> > 从python访问JVM

从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() 它给出了与以前相同的错误。

标签:JVM,python,File,访问,jvm,import,line,jpype,os
来源: https://www.cnblogs.com/xiss/p/14200956.html