Skip to content

Commit 619714b

Browse files
committed
fixed extraction of base directory
1 parent 3dfc2c8 commit 619714b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jcp/src/main/java/com/igormaznitsa/jcp/JcpPreprocessor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,9 @@ private static File getBaseDir() {
151151
if (baseDirInProperties == null) {
152152
File result;
153153
try {
154-
result = new File(
154+
final File jarFile = new File(
155155
JcpPreprocessor.class.getProtectionDomain().getCodeSource().getLocation().toURI());
156+
result = jarFile.isDirectory() ? jarFile : jarFile.getParentFile();
156157
} catch (Exception ex) {
157158
result = new File("");
158159
}

0 commit comments

Comments
 (0)