_util.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:pyjvm 作者: coderforlife 项目源码 文件源码
def jvm_load(prefer=None):
    """
    Loads the JVM dynamic library. The `prefer` argument works like for `jvm_find`. If the library
    is already loaded, this produces a warning if `prefer` doesn't match the loaded library,
    otherwise it does nothing.
    """
    global libjvm, libjvm_type
    if libjvm is not None:
        if prefer is not None and prefer != libjvm_type:
            import warnings
            warnings.warn('Already loaded JVM "%s", so preferred JVM "%s" is unloadable'%(libjvm_type,prefer))
        return
    jvm,libjvm_type = jvm_find(prefer)
    libjvm = (ctypes.windll if is_win else ctypes.cdll).LoadLibrary(jvm)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号