Skip to content

Commit 93c1766

Browse files
m-libgeorgewfraser
authored andcommitted
adding --system javac option to override the location of system modules (georgewfraser#129)
1 parent 337fa07 commit 93c1766

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/org/javacs/CompileBatch.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ private static String joinPath(Collection<Path> classOrSourcePath) {
113113
private static List<String> options(Set<Path> classPath, Set<String> addExports) {
114114
var list = new ArrayList<String>();
115115

116+
var javaHome = System.getenv("JAVA_HOME");
117+
if (javaHome != null) {
118+
Collections.addAll(list, "--system", javaHome);
119+
}
120+
116121
Collections.addAll(list, "-classpath", joinPath(classPath));
117122
Collections.addAll(list, "--add-modules", "ALL-MODULE-PATH");
118123
// Collections.addAll(list, "-verbose");

0 commit comments

Comments
 (0)