8169816: Move src.zip and jrt-fs.jar under the lib directory
Reviewed-by: alanb, erikj
This commit is contained in:
parent
c89896f3bd
commit
0a3285fcf6
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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(),
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user