test/runtime/SharedArchiveFile/SharedArchiveFile.java
Print this page
@@ -23,10 +23,11 @@
/*
* @test
* @bug 8014138
* @summary Testing new -XX:SharedArchiveFile=<file-name> option
+ * @requires (vm.opt.UseCompressedOops == null) | (vm.opt.UseCompressedOops == true)
* @library /test/lib
* @modules java.base/jdk.internal.misc
* java.management
*/
@@ -38,18 +39,18 @@
// NOTE: This test serves as a sanity test and also as an example for simple
// use of SharedArchiveFile argument. For this reason it DOES NOT use the utility
// methods to form command line to create/use shared archive.
public class SharedArchiveFile {
public static void main(String[] args) throws Exception {
- ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+ ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true,
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:dump");
OutputAnalyzer out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
CDSTestUtils.checkDump(out);
- pb = ProcessTools.createJavaProcessBuilder(
+ pb = ProcessTools.createJavaProcessBuilder(true,
"-XX:+UnlockDiagnosticVMOptions",
"-XX:SharedArchiveFile=./SharedArchiveFile.jsa",
"-Xshare:on", "-version");
out = CDSTestUtils.executeAndLog(pb, "SharedArchiveFile");
CDSTestUtils.checkExec(out);