如何在Java中卸载已加载的类? [英] How to unload an already loaded class in Java?

查看:1509
本文介绍了如何在Java中卸载已加载的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从类加载器中卸载一个类,以便我可以动态使用最近更改的类而无需重新启动我的应用程序(热部署)?是否可以这样做?

How to unload a class from the class loader, so that I can use the recently changed class on the fly without restarting my application (hot deployment)? Is it possible to do that?

推荐答案

Java反叛者即时重新加载已更改的类。有关详细信息,请参见 jrebel网站。由于性能问题,我不知道我会为生产环境推荐这个。当你为服务器重新编译时,JRebel偶尔会把事情搞得一团糟。

Java rebel reloads changed classes on the fly. See the jrebel website for details. I don't know that I would recommend this for a production environment though, because of performance issues. JRebel on occasion bogs things down momentarily when you've recompiled for a server.

这篇关于如何在Java中卸载已加载的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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