Skip to content

Commit d5eae72

Browse files
committed
DefaultJava3DService: check for all related JARs
This checks for all known variants of the Java 3D JAR files, as well as the JOGL and Gluegen dependencies. And it checks for both versioned and unversioned filenames.
1 parent dfa3700 commit d5eae72

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/main/java/org/scijava/java3d/DefaultJava3DService.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ private void checkLibExtDirectory(final ArrayList<File> files,
9696
final File dirFile = new File(dirPath.isEmpty() ? "." : dirPath);
9797
if (!dirFile.exists()) return;
9898

99-
checkFile(files, new File(dirFile, "j3dcore.jar"));
100-
checkFile(files, new File(dirFile, "vecmath.jar"));
101-
checkFile(files, new File(dirFile, "j3dutils.jar"));
102-
checkFilePattern(files, dirFile, "j3d-core.*");
103-
checkFilePattern(files, dirFile, "vecmath.*");
104-
checkFilePattern(files, dirFile, "jogl.*");
105-
// Maybe libJ3DUtils.jnilib libJ3DAudio.jnilib
99+
checkFilePattern(files, dirFile, "gluegen-rt(-[0-9].*)?\\.jar");
100+
checkFilePattern(files, dirFile, "j3d-core(-[0-9].*)?\\.jar");
101+
checkFilePattern(files, dirFile, "j3d-core-utils(-[0-9].*)?\\.jar");
102+
checkFilePattern(files, dirFile, "j3dcore(-[0-9].*)?\\.jar");
103+
checkFilePattern(files, dirFile, "j3dutils(-[0-9].*)?\\.jar");
104+
checkFilePattern(files, dirFile, "jogl(-[0-9].*)?\\.jar");
105+
checkFilePattern(files, dirFile, "vecmath(-[0-9].*)?\\.jar");
106106
}
107107

108108
private void checkFilePattern(final ArrayList<File> files,
@@ -120,8 +120,4 @@ public boolean accept(final File dir, final String name) {
120120
}
121121
}
122122

123-
private void checkFile(ArrayList<File> files, File file) {
124-
if (file.exists()) files.add(file);
125-
}
126-
127123
}

0 commit comments

Comments
 (0)