code: @Override
      public void loadAgent(String agent, String options)
          throws AgentLoadException, AgentInitializationException, IOException
      {
          String args = agent;
          if (options != null) {
              args = args + "=" + options;
          }
          try {
              loadAgentLibrary("instrument", args);
          } catch (AgentLoadException x) {
              throw new InternalError("instrument library is missing in target VM");
          } catch (AgentInitializationException x) {
              /*
               * Translate interesting errors into the right exception and
               * message (FIXME: create a better interface to the instrument
               * implementation so this isn't necessary)
               */
              int rc = x.returnValue();
              switch (rc) {
                  case JNI_ENOMEM:
                      throw new AgentLoadException("Insuffient memory");
                  case ATTACH_ERROR_BADJAR:
                      throw new AgentLoadException("Agent JAR not found or no Agent-Class attribute");
                  case ATTACH_ERROR_NOTONCP:
                      throw new AgentLoadException("Unable to add JAR file to system class path");
                  case ATTACH_ERROR_STARTFAIL:
                      throw new AgentInitializationException("Agent JAR loaded but agent failed to initialize");
                  default :
                      throw new AgentLoadException("Failed to load agent - unknown reason: " + rc);
              }
          }
      }
docs: /*
  Load JPLIS agent which will load the agent JAR file and invoke
  the agentmain method.