Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8329014

jar does not support SOURCE_DATE_EPOCH

XMLWordPrintable

    • jar
    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      openjdk 23
      windows, linux

      A DESCRIPTION OF THE PROBLEM :
      Currently the output of jar is non reproducible, for example

      ----
      mkdir out; touch out/a
      export SOURCE_DATE_EPOCH=1;jar --create --file classes.jar -C out .
      touch out/a;
      export SOURCE_DATE_EPOCH=1;jar --create --file classes2.jar -C out .
      ----

      classes.jar and classes2.jar will differ.

      It is possible to use --date with JDK 19 or newer but it is not supported by older versions of jar, at that point it might be easier to use strip-nondeterminism to support multiple environments.


      https://reproducible-builds.org/docs/source-date-epoch/

      Already explains why it is a good idea to support the environment variable (if the output of a command is not already reproducible).

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: