如何在Java中反转System.loadLibrary [英] How to reverse System.loadLibrary in Java

查看:99
本文介绍了如何在Java中反转System.loadLibrary的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个JNI程序,我想在我使用完该dll之后卸载该dll. 为此我该怎么办?我在Javadoc中找不到unloadLibrary()方法.

I am writing a JNI program and I want to unload the dll after i hava finished using it. What can I do for this purpose? I couldn't find a unloadLibrary() method in the Javadoc.

推荐答案

没有直接方法来手动卸载dll.

There is no direct way of manually unloading your dll.

简单地说,当由垃圾回收器处理加载了jni-dll的Class的ClassLoader时,您的dll将被卸载.

Put simply, your dll will be unloaded when the ClassLoader of the Class that loaded your jni-dll is handled by the garbage collector.

这篇关于如何在Java中反转System.loadLibrary的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆