<i id='Wc0et'><tr id='Wc0et'><dt id='Wc0et'><q id='Wc0et'><span id='Wc0et'><b id='Wc0et'><form id='Wc0et'><ins id='Wc0et'></ins><ul id='Wc0et'></ul><sub id='Wc0et'></sub></form><legend id='Wc0et'></legend><bdo id='Wc0et'><pre id='Wc0et'><center id='Wc0et'></center></pre></bdo></b><th id='Wc0et'></th></span></q></dt></tr></i><div id='Wc0et'><tfoot id='Wc0et'></tfoot><dl id='Wc0et'><fieldset id='Wc0et'></fieldset></dl></div>

<small id='Wc0et'></small><noframes id='Wc0et'>

      • <bdo id='Wc0et'></bdo><ul id='Wc0et'></ul>
    1. <tfoot id='Wc0et'></tfoot>

    2. <legend id='Wc0et'><style id='Wc0et'><dir id='Wc0et'><q id='Wc0et'></q></dir></style></legend>

      从 python 访问 JVM

      时间:2023-08-23
        <tbody id='W2oGE'></tbody>

      <i id='W2oGE'><tr id='W2oGE'><dt id='W2oGE'><q id='W2oGE'><span id='W2oGE'><b id='W2oGE'><form id='W2oGE'><ins id='W2oGE'></ins><ul id='W2oGE'></ul><sub id='W2oGE'></sub></form><legend id='W2oGE'></legend><bdo id='W2oGE'><pre id='W2oGE'><center id='W2oGE'></center></pre></bdo></b><th id='W2oGE'></th></span></q></dt></tr></i><div id='W2oGE'><tfoot id='W2oGE'></tfoot><dl id='W2oGE'><fieldset id='W2oGE'></fieldset></dl></div>
        <bdo id='W2oGE'></bdo><ul id='W2oGE'></ul>

          <legend id='W2oGE'><style id='W2oGE'><dir id='W2oGE'><q id='W2oGE'></q></dir></style></legend>
          • <small id='W2oGE'></small><noframes id='W2oGE'>

              1. <tfoot id='W2oGE'></tfoot>
                本文介绍了从 python 访问 JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                >>> import boilerpipe
                Traceback (most recent call last):
                  File "<stdin>", line 1, in <module>
                  File "C:Anacondalibsite-packagesoilerpipe\__init__.py", line 10, in <module>
                    jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.class.path=%s" % os.pathsep.join(jars))
                  File "C:Anacondalibsite-packagesjpype\_core.py", line 50, in startJVM
                    _jpype.startup(jvm, tuple(args), True)
                RuntimeError: Unable to load DLL [C:Program FilesJavajre7inclientjvm.dll], error = The specified module could not be found.
                 at nativecommonincludejp_platform_win32.h:58
                

                试过了:重新安装jvm

                Tried: Reinstalling jvm

                >> import ctypes
                >> import os
                >> os.chdir(r"<path to Java bin client folder>")
                >> ctypes.CDLL("jvm.dll")
                Still unable to fix
                

                尝试下面的代码,仍然卡住:

                Tried code below, still stuck:

                从 py4j.java_gateway 导入 JavaGateway网关 = JavaGateway()它给出了与以前相同的错误.

                from py4j.java_gateway import JavaGateway gateway = JavaGateway() It gives the same error as before.

                推荐答案

                请检查!

                1. 给出真实路径("C:\Program Files\Java\jre7\binclient\jvm.dll")
                2. 检查所有 32 位或 64 位(我的报价始终使用 32 位 Anaconda、JRE7、Python 等)
                3. 安装pywin32(当然是python2.7.9)
                4. 授予jvm.dll权限(可以运行)
                5. 一切都ok了,试试:import ctypes ctypes.CDLL('C:\Program Files\Java\jre7\bin\client\jvm.dll')
                1. Give a true path ("C:\Program Files\Java\jre7\binclient\jvm.dll")
                2. Check all 32 or 64 bit (my offer always use 32bit Anaconda,JRE7,Python etc.)
                3. Install pywin32 (of course python2.7.9)
                4. Give permission to jvm.dll(can run)
                5. After all is ok, try: import ctypes ctypes.CDLL('C:\Program Files\Java\jre7\bin\client\jvm.dll')

                ***可能有些java版本的hook不能抛出我用 jre-7u55-windows-i586.exe

                ***Maybe can't throw the hook of some java versions i used jre-7u55-windows-i586.exe

                希望对您有所帮助!最好的问候!

                i hope helpful ! Best regards !

                适用于葡萄酒(无错误):

                Works on wine(no bug):

                这篇关于从 python 访问 JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:java中构造函数的返回类型是什么? 下一篇:JVM 是否有能力检测并行化机会?

                相关文章

              2. <legend id='JlErq'><style id='JlErq'><dir id='JlErq'><q id='JlErq'></q></dir></style></legend>
              3. <i id='JlErq'><tr id='JlErq'><dt id='JlErq'><q id='JlErq'><span id='JlErq'><b id='JlErq'><form id='JlErq'><ins id='JlErq'></ins><ul id='JlErq'></ul><sub id='JlErq'></sub></form><legend id='JlErq'></legend><bdo id='JlErq'><pre id='JlErq'><center id='JlErq'></center></pre></bdo></b><th id='JlErq'></th></span></q></dt></tr></i><div id='JlErq'><tfoot id='JlErq'></tfoot><dl id='JlErq'><fieldset id='JlErq'></fieldset></dl></div>

                    <small id='JlErq'></small><noframes id='JlErq'>

                    • <bdo id='JlErq'></bdo><ul id='JlErq'></ul>

                    <tfoot id='JlErq'></tfoot>