# Class JavaWrapper

java.lang.Object
org.apache.bcel.util.JavaWrapper

public class JavaWrapper extends Object
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:
  - `ClassLoader`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JavaWrapper()`
  `JavaWrapper(ClassLoader loader)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `main(String[] argv)`
  Default main method used as wrapper, expects the fully qualified class name of the real class as the first argument.
  `void`
  `runMain(String className, String[] argv)`
  Runs the main method of the given class with the arguments passed in argv

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### JavaWrapper

    public JavaWrapper()

  - ### JavaWrapper

    public JavaWrapper(ClassLoader loader)

- ## Method Details

  - ### main

    public static void main(String[] argv) throws Exception
    Default main method used as wrapper, expects the fully qualified class name of the real class as the first argument.
    Throws:
      `Exception`

  - ### runMain

    public void runMain(String className, String[] argv) throws ClassNotFoundException
    Runs the main method of the given class with the arguments passed in argv
    Parameters:
      `className` - the fully qualified class name
      `argv` - the arguments just as you would pass them directly
    Throws:
      `ClassNotFoundException` - if `className` can't be found.