8169816: Move src.zip and jrt-fs.jar under the lib directory
authormchung
Mon, 28 Nov 2016 11:36:43 -0800
changeset 42404 c4a34c2a656c
parent 42403 27f4a3ee0c27
child 42405 4b92e12263de
8169816: Move src.zip and jrt-fs.jar under the lib directory Reviewed-by: alanb, erikj, jjg
langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java
langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java
--- a/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java	Mon Nov 28 09:20:13 2016 +0100
+++ b/langtools/src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java	Mon Nov 28 11:36:43 2016 -0800
@@ -1396,7 +1396,8 @@
         }
 
         private void update(Path p) {
-            if (!isCurrentPlatform(p) && !Files.exists(p.resolve("jrt-fs.jar")) && !Files.exists(systemJavaHome.resolve("modules")))
+            if (!isCurrentPlatform(p) && !Files.exists(p.resolve("lib").resolve("jrt-fs.jar")) &&
+                    !Files.exists(systemJavaHome.resolve("modules")))
                 throw new IllegalArgumentException(p.toString());
             systemJavaHome = p;
             modules = null;
--- a/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java	Mon Nov 28 09:20:13 2016 +0100
+++ b/langtools/src/jdk.jshell/share/classes/jdk/jshell/SourceCodeAnalysisImpl.java	Mon Nov 28 11:36:43 2016 -0800
@@ -1273,7 +1273,7 @@
         }
         List<Path> result = new ArrayList<>();
         Path home = Paths.get(System.getProperty("java.home"));
-        Path srcZip = home.resolve("src.zip");
+        Path srcZip = home.resolve("lib").resolve("src.zip");
         if (!Files.isReadable(srcZip))
             srcZip = home.getParent().resolve("src.zip");
         if (Files.isReadable(srcZip)) {