public class JarClassLoader
extends java.net.URLClassLoader
Constructor and Description |
---|
JarClassLoader(java.net.URL url)
Creates a new JarClassLoader for the specified url.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMainClassName()
Returns the name of the jar file main class, or null if
no "Main-Class" manifest attributes was defined.
|
java.util.jar.Attributes |
getManifestEntries()
Returns the entries in the JAR manifest
|
void |
invokeClass(java.lang.String name,
java.lang.String[] args)
Invokes the application in this jar file given the name of the
main class and an array of arguments.
|
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public JarClassLoader(java.net.URL url)
url
- the url of the jar filepublic java.lang.String getMainClassName() throws java.io.IOException
java.io.IOException
public java.util.jar.Attributes getManifestEntries() throws java.io.IOException
java.io.IOException
public void invokeClass(java.lang.String name, java.lang.String[] args) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException
name
- the name of the main classargs
- the arguments for the applicationjava.lang.ClassNotFoundException
- if the specified class could not
be foundjava.lang.NoSuchMethodException
- if the specified class does not
contain a "main" methodjava.lang.reflect.InvocationTargetException
- if the application raised an
exceptionORO is a part of the OpenRobots framework.
openrobots@laas.fr
LAAS-CNRS 2009-2011