diff a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/CDSPlugin.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/CDSPlugin.java --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/CDSPlugin.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/CDSPlugin.java @@ -1,7 +1,7 @@ /* - * Copyright (c) 2021, 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this @@ -58,11 +58,11 @@ } else { return "java"; } } - private void generateCDSArchive(ExecutableImage image, boolean noCoops, boolean noCoh) { + private void generateCDSArchive(ExecutableImage image, boolean noCoops) { List javaCmd = new ArrayList(); Path javaPath = image.getHome().resolve("bin").resolve(javaExecutableName()); if (!Files.exists(javaPath)) { throw new PluginException("Cannot find java executable at: " + javaPath.toString()); } @@ -71,14 +71,10 @@ String archiveMsg = "CDS"; if (noCoops) { javaCmd.add("-XX:-UseCompressedOops"); archiveMsg += "-NOCOOPS"; } - if (noCoh) { - javaCmd.add("-XX:-UseCompactObjectHeaders"); - archiveMsg += "-NOCOH"; - } ProcessBuilder builder = new ProcessBuilder(javaCmd); int status = -1; try { Process p = builder.inheritIO().start(); status = p.waitFor(); @@ -102,17 +98,16 @@ runtimePlatform.toString()); } Path classListPath = image.getHome().resolve("lib").resolve("classlist"); if (Files.exists(classListPath)) { - generateCDSArchive(image, false, false); + generateCDSArchive(image,false); - // Generate all of the CDS archive combinations: nocoops, nocoh, nocoops_nocoh. + // The targetPlatform is the same as the runtimePlatform. + // For a 64-bit platform, generate the non-compressed oop CDS archive if (Architecture.is64bit()) { - generateCDSArchive(image, true, false); - generateCDSArchive(image, false, true); - generateCDSArchive(image, true, true); + generateCDSArchive(image,true); } System.out.println("Created CDS archive successfully"); } else { throw new PluginException("Cannot generate CDS archives: classlist not found: " + classListPath.toString());