diff --git a/pom.xml b/pom.xml
index 8a47e77..3394dd2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,5 +92,10 @@
commons-lang
2.6
+
+ commons-io
+ commons-io
+ 2.11.0
+
\ No newline at end of file
diff --git a/src/main/java/de/chaos/swlnmngr/route/routes/LinkRoute.java b/src/main/java/de/chaos/swlnmngr/route/routes/LinkRoute.java
index 3b2fd95..debf7e8 100644
--- a/src/main/java/de/chaos/swlnmngr/route/routes/LinkRoute.java
+++ b/src/main/java/de/chaos/swlnmngr/route/routes/LinkRoute.java
@@ -2,6 +2,7 @@ package de.chaos.swlnmngr.route.routes;
import de.chaos.swlnmngr.Main;
import de.chaos.swlnmngr.config.Config;
+import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
@@ -36,7 +37,13 @@ public class LinkRoute implements Route {
}
File link = new File(projectDir, "lib");
try {
- Files.deleteIfExists(link.toPath());
+ if(link.exists()) {
+ if(link.isDirectory()) {
+ FileUtils.deleteDirectory(link);
+ } else {
+ FileUtils.delete(link);
+ }
+ }
Main.getLogger().debug(libsFile);
Main.getLogger().debug(link);
Path linkPath = Files.createSymbolicLink(link.toPath(), libsFile.toPath());