From ec04f01a10b8a6f24aa3165a252a67a1b4f41f6e Mon Sep 17 00:00:00 2001 From: Daniel Holle Date: Mon, 6 Nov 2023 12:30:42 +0100 Subject: [PATCH] Allow relative paths by getting the absolute file (seriously Java) --- .../de/dhbwstuttgart/environment/CompilationEnvironment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/de/dhbwstuttgart/environment/CompilationEnvironment.java b/src/main/java/de/dhbwstuttgart/environment/CompilationEnvironment.java index b26d1eee..0e2a4534 100644 --- a/src/main/java/de/dhbwstuttgart/environment/CompilationEnvironment.java +++ b/src/main/java/de/dhbwstuttgart/environment/CompilationEnvironment.java @@ -75,7 +75,7 @@ public class CompilationEnvironment { ClassLoader classLoader = compiler.getClassLoader(); List ret = new ArrayList<>(); // Set classLoader to include default package for this specific source file - File dir = sourceFile.getParentFile(); + File dir = sourceFile.getAbsoluteFile().getParentFile(); String dirPath = dir.toString() + "/"; if (packageName.length() > 0) dirPath = dirPath.substring(0, dirPath.length() - packageName.length() - 1);