Skip to content

Commit d7aaf0a

Browse files
committed
Add a method to detect if the JVM is OpenJDK
1 parent 3519d38 commit d7aaf0a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main/java/org/scijava/plugins/scripting/javascript/JavaScriptScriptLanguage.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ public boolean isRhino() {
7979
return getEngineName().contains("Rhino");
8080
}
8181

82+
/** Returns true iff the JVM appears to be the OpenJDK version of Java. */
83+
public boolean isOpenJDK() {
84+
final String vmName = System.getProperty("java.vm.name");
85+
return vmName != null && vmName.startsWith("OpenJDK");
86+
}
87+
8288
// -- ScriptEngineFactory methods --
8389

8490
@Override

0 commit comments

Comments
 (0)