Skip to content

Commit c4038d5

Browse files
author
Muhammad Hammad
committed
Java 21
1 parent 90545ed commit c4038d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/org/dvare/dynamic/SourceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ public void stringSourceImportCompileTest() throws Exception {
6363

6464
DynamicCompiler dynamicCompiler = new DynamicCompiler();
6565
try {
66-
Class.forName("com.sun.tools.sjavac.Module"); //if java module present
67-
dynamicCompiler.addCompilerOption(DynamicCompilerOption.ADD_EXPORTS, "java.base/java.time=ALL-UNNAMED");
66+
if (DynamicCompiler.isJava9OrAbove())//if java module present
67+
{
68+
dynamicCompiler.addCompilerOption(DynamicCompilerOption.ADD_EXPORTS, "java.base/java.time=ALL-UNNAMED");
69+
}
6870
} catch (Exception ignored) {
6971
}
7072
dynamicCompiler.addSource("org.dvare.dynamic.DateUtil", sourceCode);

0 commit comments

Comments
 (0)