classloader

Unloading classes in java?

丶灬走出姿态 提交于 2019-11-25 21:59:42
问题 I have a custom class loader so that a desktop application can dynamically start loading classes from an AppServer I need to talk to. We did this since the amount of jars that are required to do this are ridiculous (if we wanted to ship them). We also have version problems if we don\'t load the classes dynamically at run time from the AppServer library. Now, I just hit a problem where I need to talk to two different AppServers and found that depending on whose classes I load first I might

How should I load Jars dynamically at runtime?

做~自己de王妃 提交于 2019-11-25 21:41:33
问题 Why is it so hard to do this in Java? If you want to have any kind of module system you need to be able to load jars dynamically. I\'m told there\'s a way of doing it by writing your own ClassLoader , but that\'s a lot of work for something that should (in my mind at least) be as easy as calling a method with a jar file as its argument. Any suggestions for simple code that does this? 回答1: The reason it's hard is security. Classloaders are meant to be immutable; you shouldn't be able to willy

Is it possible to dynamically load a library at runtime from an Android application?

試著忘記壹切 提交于 2019-11-25 20:21:17
Is there any way to make an Android application to download and use a Java library at runtime? Here is an example: Imagine that the application needs to make some calculations depending on the input values. The application asks for these input values and then checks if the required Classe s or Method s are available. If not, it connects to a server, downloads the needed library, and loads it at runtime to calls the required methods using reflection techniques. The implementation could change depending on various criteria such as the user who is downloading the library. Sorry, I'm late and the