diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/ProcessUtils.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/ProcessUtils.java index 1ac11ba1..c02154b7 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/ProcessUtils.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/ProcessUtils.java @@ -125,4 +125,22 @@ public class ProcessUtils }); } } + + public static void runDecompilerExternal(String[] args, boolean exceptionToGUI) throws IOException, InterruptedException + { + try + { + ProcessBuilder pb = new ProcessBuilder(args); + Process p = pb.start(); + BytecodeViewer.createdProcesses.add(p); + p.waitFor(); + } + catch (Exception e) + { + if(exceptionToGUI) + BytecodeViewer.handleException(e); + else + throw e; + } + } }