void (String directives) { File tmpFile = null; try { tmpFile = FileUtil.createTempFile("c2_directive", "json"); FileUtil.writeToFile(tmpFile, directives); VirtualMachine vm = VirtualMachine.attach(OSProcessUtil.getApplicationPid()); HotSpotVirtualMachine hvm = (HotSpotVirtualMachine)vm; hvm.executeJCmd("Compiler.directives_clear"); hvm.executeJCmd("Compiler.directives_add " + tmpFile.getAbsolutePath()); vm.detach(); } catch (Exception e) { LOG.error(e); } finally { if (tmpFile != null) { FileUtil.delete(tmpFile); } } }