Java中如何将一个内存中的class free掉,这样,我就可以实现当我的class更新后,在不中断程序的情况下,通过一个Button,执行最新的class?

verybigbug 2002-01-02 10:59:24
Java中如何将一个内存中的class free掉,这样,我就可以实现当我的class更新后,在不中断程序的情况下,通过一个Button,执行最新的class?
...全文
91 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
verybigbug 2002-01-03
  • 打赏
  • 举报
回复
upup
skyyoung 2002-01-02
  • 打赏
  • 举报
回复
In general, this is a very hard thing to do.
The first thing you should do is understand how Java handle loading and unloading of classes. Take a look at the Java Language Specification, version 2, Section 12.7 "Unloading of Classes and Interfaces".

The short answer is: Before you can load/unload a class you need to instantiate your own class loader. You can then load the class. When you want to unload the class, you also have to unload the class loader used to load your class. After you have unloaded your class loader you can load another class loader, and then reload your class.

http://developer.java.sun.com/developer/TechTips/2000/tt1027.html#tip3
verybigbug 2002-01-02
  • 打赏
  • 举报
回复
??
xname 2002-01-02
  • 打赏
  • 举报
回复
初学者我也想知道
verybigbug 2002-01-02
  • 打赏
  • 举报
回复
U
P
verybigbug 2002-01-02
  • 打赏
  • 举报
回复
对了,这个例子在UNIX下可以用,但在Windows下无效。。。。。。痛!!!!
verybigbug 2002-01-02
  • 打赏
  • 举报
回复
这个例子好像不能得到它说的结果嘛。

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧