diff --git a/src/test/java/com/overstock/sample/processor/Compiler.java b/src/test/java/com/overstock/sample/processor/Compiler.java index ea481e0..2e2472b 100644 --- a/src/test/java/com/overstock/sample/processor/Compiler.java +++ b/src/test/java/com/overstock/sample/processor/Compiler.java @@ -87,7 +87,15 @@ private static String buildClassPath(File outputDir) { } private static String classPathFor(Class clazz) { - return clazz.getProtectionDomain().getCodeSource().getLocation().getFile(); + URL url = clazz.getProtectionDomain().getCodeSource().getLocation(); + + try { + URI uri = url.toURI(); + + return Paths.get(uri).toFile().getAbsolutePath(); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } } protected File writeSourceFile(SourceFile sourceFile) throws IOException {