diff --git a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java index f6da7bc988..6310b58e91 100644 --- a/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java +++ b/pmd-cli/src/main/java/net/sourceforge/pmd/cli/commands/internal/CpdGuiCommand.java @@ -15,6 +15,13 @@ public class CpdGuiCommand implements Runnable { @Override public void run() { new GUI(); + + // wait for the process to be killed by the GUI + try { + Thread.currentThread().join(); + } catch (InterruptedException ignored) { + // noop + } } }