diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java index dcc9329c..8c502742 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/Constants.java @@ -57,15 +57,20 @@ public class Constants //hides the BCV directory if (isWindows() && !BCVDir.isHidden()) { - try { - BytecodeViewer.sm.pauseBlocking(); - // Hide file by running attrib system command (on Windows) - Runtime.getRuntime().exec("attrib +H " + BCVDir.getAbsolutePath()); - } catch (Exception e) { - //ignore - } finally { - BytecodeViewer.sm.resumeBlocking(); - } + new Thread(()->{ + try { + BytecodeViewer.sm.pauseBlocking(); + + // Hide file by running attrib system command (on Windows) + Process p = new ProcessBuilder("attrib", + "+H", + BCVDir.getAbsolutePath()).start(); + } catch (Exception e) { + //ignore + } finally { + BytecodeViewer.sm.resumeBlocking(); + } + }, "Hide BCV Dir").start(); } return BCVDir.getAbsolutePath();