code: public static void main(String[] args) {
          try {
              start(args);
          } catch (Exception e) {
              System.err.println("Hawkular Java Agent failed at startup");
              e.printStackTrace(System.err);
              return;
          }
  
          // so main doesn't exit
          synchronized (JavaAgent.class) {
              try {
                  JavaAgent.class.wait();
              } catch (InterruptedException e) {
              }
          }
      }
docs: an agent can be started in its own VM as the main class