use proper javac for migration tests

This commit is contained in:
wea_ondara
2022-09-10 13:19:12 +02:00
parent 4e90b7cc90
commit 4e75ce3b2e

View File

@@ -10,6 +10,7 @@ import java.net.URLClassLoader;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.StandardOpenOption; import java.nio.file.StandardOpenOption;
import java.util.Locale;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@@ -81,8 +82,12 @@ public class MigrationCreatorTestBase {
//dest //dest
File destdir = getClassFilesDir(); File destdir = getClassFilesDir();
var javaHome = System.getProperty("java.home");
var isWindows = System.getProperty("os.name").toLowerCase(Locale.ROOT).equals("win");
var javac = new File(javaHome, "bin/javac" + (isWindows ? ".exe" : ""));
var process = new ProcessBuilder() var process = new ProcessBuilder()
.command("javac", //TODO use javac for current jdk .command(javac.getAbsolutePath(),
"-cp", "target/classes" + File.pathSeparator + "target/test-classes", "-cp", "target/classes" + File.pathSeparator + "target/test-classes",
"-encoding", "UTF8", "-encoding", "UTF8",
"-g", //debug symbols "-g", //debug symbols