问题:
https://bbs.csdn.net/topics/390893838
记录一下解决方案:
public synchronized static void unloadNativeLibs(String libName) {
try {
ClassLoader classLoader = SimulatorCfgEditPage.class.getClassLoader();
Field field = ClassLoader.class.getDeclaredField("nativeLibraries");
field.setAccessible(true);
Vector<Object> libs = (Vector<Object>) field.get(classLoader);
Iterator it = libs.iterator();
Object object;
while (it.hasNext()) {
object = it.next();
Field[] fs = object.getClass().getDeclaredFields();
boolean hasInit = false;
for (int k = 0; k < fs.length; k++) {
if (fs[k].getName().equals("name")) {
fs[k].setAccessible(true);
String dllPath = fs[k].get(object).toString();
if (dllPath.endsWith(libName)) {
hasInit &