urlclassloader

java web start alternative [closed]

Deadly 提交于 2019-11-26 16:43:28
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . We're looking for an alternative to Java web start that effectively does the same thing, just better implemented. We're having massive trouble with it. We have a few offices of XP desktops, all slightly different and so far only a handful have worked without serious tweaking. Problems are to do with not playing

Java security: Sandboxing plugins loaded via URLClassLoader

ぐ巨炮叔叔 提交于 2019-11-26 15:36:12
问题 Question summary: How do I modify the code below so that untrusted, dynamically-loaded code runs in a security sandbox while the rest of the application remains unrestricted? Why doesn't URLClassLoader just handle it like it says it does? EDIT: Updated to respond to Ani B. EDIT 2: Added updated PluginSecurityManager. My application has a plug-in mechanism where a third party can provide a JAR containing a class which implements a particular interface. Using URLClassLoader, I am able to load

Add jar to classpath at runtime under java 9

人盡茶涼 提交于 2019-11-26 11:30:07
问题 Until java9 for adding external jar to classpath in runtime by programmatically everybody used: URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader(); Method method = URLClassLoader.class.getDeclaredMethod(\"addURL\", new Class[]{URL.class}); method.invoke(sysloader, new Object[]{file.toURI().toURL()}); Now with java9 we have problem: Exception in thread \"main\" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to

Is it possible to “add” to classpath dynamically in java?

匆匆过客 提交于 2019-11-26 05:31:53
问题 java -classpath ../classes;../jar;. parserTester How can i get the functionality in the above command programmatically? Like, is it possible to run as: java parserTester and get the same result? I tried using URLClassLoader but it modifies the classpath and does not add to it. Thanx! Thanks for the response Milhous. But that is what i am trying to do.. How is it possible to get the jar into the classpath first? I tried using a custom classloader too :( That works.. But sorry that i need to