Skip to content

Commit

Permalink
fix java c on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
valenad1 committed Apr 24, 2024
1 parent d05298b commit eb9b66b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gradle/javaIgnoreSymbolFile.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import org.apache.tools.ant.taskdefs.condition.Os

compileJava {
// This only works when forking and passing 'javac' as an executable
options.compilerArgs << '-XDignore.symbol.file'
options.fork = true
if (System.env.JAVA_HOME != null) {
options.forkOptions.executable = "${System.env.JAVA_HOME}/bin/javac"
if (Os.isFamily(Os.FAMILY_WINDOWS))
options.forkOptions.executable = "${System.env.JAVA_HOME}/bin/javac.exe"
else
options.forkOptions.executable = "${System.env.JAVA_HOME}/bin/javac"
} else {
// JAVA_HOME is not set. Using expected javac location
options.forkOptions.executable = "/usr/bin/javac"
Expand Down

0 comments on commit eb9b66b

Please sign in to comment.