RFR: 8076090: jimage extract + recreate broken again

Jim Laskey (Oracle) james.laskey at oracle.com
Thu Apr 9 14:59:05 UTC 2015

Thanks Mandy.  Changed the main to ;

    public static void main(String[] args) {
        final String JAVA_HOME = System.getProperty("java.home");
        Path jimagePath = Paths.get(JAVA_HOME, "bin", "jimage");
        Path bootimagePath = Paths.get(JAVA_HOME, "lib", "modules", "bootmodules.jimage");

        if (Files.exists(jimagePath) && Files.exists(bootimagePath)) {
            String jimage = jimagePath.toAbsolutePath().toString();
            String bootimage = bootimagePath.toAbsolutePath().toString();
            String extractDir = Paths.get(".", "extract").toAbsolutePath().toString();
            String recreateImage = Paths.get(".", "recreate.jimage").toAbsolutePath().toString();

            exec(new String[] {jimage, "extract", "--dir", extractDir, bootimage});
            exec(new String[] {jimage, "recreate", "--dir", extractDir, recreateImage});

            System.err.println("Test successful");
         } else {
            System.err.println("Test skipped, no module image");

Running jprt - okay to push after that?


-- Jim

> On Apr 8, 2015, at 3:37 PM, Mandy Chung <mandy.chung at oracle.com> wrote:
> Forwarding to core-libs-dev for review (bcc jdk9-dev)
> On 4/8/2015 11:02 AM, Jim Laskey (Oracle) wrote:
>> The fix addresses problem with the jimage tool rebuilding meta data on windows systems (\ in path.)  Including new test to verify that jimage tool does successfully extract and recreate.
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8076090
>> Webrev: http://cr.openjdk.java.net/~jlaskey/8076090/webrev/index.html
> Looks fine to me.
> The test will need to check if $JAVA_HOME is an exploded image ($JAVA_HOME/lib/modules not exists); if so, it should simply exit. Otherwise the test will fail.   Nit: line 24 is not unused.
> FYI.  jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java could be used.
> Mandy

More information about the core-libs-dev mailing list