It's often convenient to run jcmd command programmatically from within a testcase to get some information or to adjust options.

See the template below:

// import;
// import;

 public static void reloadCompilerDirectives(String filename) {
    String result;
    result = doRunDcmd("compilerDirectivesClear", new String[]{""});
    result = doRunDcmd("compilerDirectivesAdd", new String[]{ filename });

  private static String doRunDcmd(String operationName, String operationArgs[]) {
      ObjectName objectName = 
          new ObjectName("");
      MBeanServer mbeanServer = 
      Object[] params = new Object[] { operationArgs };
      String[] signature = new String[]{ String[].class.getName() };
      return(String) mbeanServer.invoke(objectName, operationName, params, signature);

xip is an old archive format used to distribute XCode.  it's actually an xar format but with ability to be signed. If you installing the same software multiple times and don't want to spend time to verify known to be valid signature, instead of xip -x do the following (you can use xar -x -f instead of bsdtar xvf):

bsdtar xvf Archive.xip

ditto -x Content .