Package org.apache.bcel.util
Class JavaWrapper
java.lang.Object
org.apache.bcel.util.JavaWrapper
Java interpreter replacement, i.e., wrapper that uses its own ClassLoader
to modify/generate classes as they're requested. You can take this as a template
for your own applications.
Call this wrapper with:
java org.apache.bcel.util.JavaWrapper <real.class.name> [arguments]
To use your own class loader you can set the "bcel.classloader" system property.
java org.apache.bcel.util.JavaWrapper -Dbcel.classloader=foo.MyLoader <real.class.name> [arguments]
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Default main method used as wrapper, expects the fully qualified class name of the real class as the first argument.void
Runs the main method of the given class with the arguments passed in argv
-
Constructor Details
-
JavaWrapper
-
JavaWrapper
public JavaWrapper()
-
-
Method Details
-
runMain
Runs the main method of the given class with the arguments passed in argv- Parameters:
class_name
- the fully qualified class nameargv
- the arguments just as you would pass them directly- Throws:
ClassNotFoundException
-
main
Default main method used as wrapper, expects the fully qualified class name of the real class as the first argument.- Throws:
Exception
-