mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8142968: Module System implementation
Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Co-authored-by: Alex Buckley <alex.buckley@oracle.com> Co-authored-by: Jonathan Gibbons <jonathan.gibbons@oracle.com> Co-authored-by: Karen Kinnear <karen.kinnear@oracle.com> Co-authored-by: Mandy Chung <mandy.chung@oracle.com> Co-authored-by: Mark Reinhold <mark.reinhold@oracle.com> Co-authored-by: Jan Lahoda <jan.lahoda@oracle.com> Co-authored-by: Vicente Romero <vicente.romero@oracle.com> Co-authored-by: Andreas Lundblad <andreas.lundblad@oracle.com> Co-authored-by: Andrey Nazarov <andrey.x.nazarov@oracle.com> Co-authored-by: Chris Hegarty <chris.hegarty@oracle.com> Co-authored-by: Erik Joelsson <erik.joelsson@oracle.com> Co-authored-by: Kumar Srinivasan <kumar.x.srinivasan@oracle.com> Co-authored-by: Sundararajan Athijegannathan <sundararajan.athijegannathan@oracle.com> Reviewed-by: jjg, jlahoda, vromero, mcimadamore, bpatel, ksrini, darcy, anazarov, dfuchs
This commit is contained in:
parent
8cffe4fb02
commit
001ebb3a72
879 changed files with 26184 additions and 9697 deletions
|
@ -44,30 +44,18 @@ public class VersionOpt {
|
|||
// Test functions by comparing the version string from javac against
|
||||
// a "golden" version generated automatically from the underlying JVM.
|
||||
// As such, it is only effective in testing the "standard" compiler,
|
||||
// and not any development version being tested via -Xbootclasspath.
|
||||
// and not any development version being tested via -Xpatch.
|
||||
// Check the version of the compiler being used, and let the test pass
|
||||
// automatically if is is a development version.
|
||||
Class<?> javacClass = com.sun.tools.javac.Main.class;
|
||||
URL javacURL = getClass().getClassLoader().getResource(javacClass.getName().replace(".", "/") + ".class");
|
||||
if (!javacURL.getProtocol().equals("jar") || !javacURL.getFile().contains("!")) {
|
||||
System.err.println("javac not found in tools.jar: " + javacURL);
|
||||
System.err.println("rest of test skipped");
|
||||
return;
|
||||
}
|
||||
String javacHome = javacURL.getFile().substring(0, javacURL.getFile().indexOf("!"));
|
||||
|
||||
File javaHome = new File(System.getProperty("java.home"));
|
||||
if (javaHome.getName().equals("jre"))
|
||||
javaHome = javaHome.getParentFile();
|
||||
File toolsJar = new File(new File(javaHome, "lib"), "tools.jar");
|
||||
|
||||
if (!javacHome.equalsIgnoreCase(toolsJar.toURI().toString())) {
|
||||
System.err.println("javac not found in tools.jar: " + javacHome);
|
||||
URL location = javacClass.getProtectionDomain().getCodeSource().getLocation();
|
||||
if (!location.toString().equals("jrt:/jdk.compiler")) {
|
||||
System.err.println("javac not found in system image: " + location);
|
||||
System.err.println("rest of test skipped");
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println("javac found in " + toolsJar);
|
||||
System.out.println("javac found in " + location);
|
||||
|
||||
String javaVersion = System.getProperty("java.version");
|
||||
String javaRuntimeVersion = System.getProperty("java.runtime.version");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue