public class JarLoader extends Object
Agent. The agent must be included in a JAR that
registers it by the Agent-Class property of its MANIFEST.MF file.
This class can either used inside the julielab-java-utilities JAR file directly, which has the Agent-Class
property set for its manifest. When building a fat JAR, e.g. with the Maven assembly or Maven shadow plugins,
containing this class, the fat JAR must have the property itself.| Constructor and Description |
|---|
JarLoader() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addJarToClassPath(File jarFile) |
static void |
loadLibraryWithURLClassloader(File jar)
https://stackoverflow.com/questions/27187566/load-jar-dynamically-at-runtime
|
public static void addJarToClassPath(File jarFile)
public static void loadLibraryWithURLClassloader(File jar) throws Exception
WARNING: This only works up to Java 8. Beginning with Java 9, the system classloader is not an URLClassLoader any more. Adds the supplied Java Archive library to java.class.path. This is benign if the library is already loaded.
ExceptionCopyright © 2019 JULIE Lab, Germany. All rights reserved.