8169816: Move src.zip and jrt-fs.jar under the lib directory

Reviewed-by: alanb, erikj
This commit is contained in:
Mandy Chung 2016-11-28 11:37:00 -08:00
parent c89896f3bd
commit 0a3285fcf6
4 changed files with 10 additions and 6 deletions

View File

@ -115,7 +115,7 @@ public final class JrtFileSystemProvider extends FileSystemProvider {
private FileSystem newFileSystem(String targetHome, URI uri, Map<String, ?> env)
throws IOException {
Objects.requireNonNull(targetHome);
Path jrtfs = FileSystems.getDefault().getPath(targetHome, JRT_FS_JAR);
Path jrtfs = FileSystems.getDefault().getPath(targetHome, "lib", JRT_FS_JAR);
if (Files.notExists(jrtfs)) {
throw new IOException(jrtfs.toString() + " not exist");
}

View File

@ -113,12 +113,16 @@ abstract class SystemImage {
if (cs == null)
return System.getProperty("java.home");
// assume loaded from $TARGETJDK/jrt-fs.jar
// assume loaded from $TARGETJDK/lib/jrt-fs.jar
URL url = cs.getLocation();
if (!url.getProtocol().equalsIgnoreCase("file"))
throw new RuntimeException(url + " loaded in unexpected way");
throw new InternalError(url + " loaded in unexpected way");
try {
return Paths.get(url.toURI()).getParent().toString();
Path lib = Paths.get(url.toURI()).getParent();
if (!lib.getFileName().toString().equals("lib"))
throw new InternalError(url + " unexpected path");
return lib.getParent().toString();
} catch (URISyntaxException e) {
throw new InternalError(e);
}

View File

@ -68,7 +68,7 @@ public class Main {
}
private static FileSystem createFsWithURLClassloader(String javaHome) throws IOException{
URL url = Paths.get(javaHome, "jrt-fs.jar").toUri().toURL();
URL url = Paths.get(javaHome, "lib", "jrt-fs.jar").toUri().toURL();
URLClassLoader loader = new URLClassLoader(new URL[] { url });
return FileSystems.newFileSystem(URI.create("jrt:/"),
Collections.emptyMap(),

View File

@ -64,7 +64,7 @@ public class RemoteRuntimeImageTest {
String java = jdk8Path.resolve("bin/java").toAbsolutePath().toString();
String javac = jdk8Path.resolve("bin/javac").toAbsolutePath().toString();
Files.createDirectories(Paths.get(".", CLASSES_DIR));
String jrtJar = Paths.get(TEST_JAVAHOME, JRTFS_JAR).toAbsolutePath().toString();
String jrtJar = Paths.get(TEST_JAVAHOME, "lib", JRTFS_JAR).toAbsolutePath().toString();
// Compose command-lines for compiling and executing tests
List<List<String>> cmds = Arrays.asList(