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

Cannot compile a ContentSigner implementation with "-release 8"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 15
    • Fix Version/s: tbd
    • Component/s: tools
    • Labels:
      None

      Description

      com.sun.jarsigner.ContentSigner is a JDK specific API that existed in JDK 8. It used to be in tools.jar. It is currently in the jdk.jartool module (com.sun.jarsigner is an exported package). It's not currently possible to compile code using ContentSigner with --release 8.

      How to reproduce:

      c $ cat X.java
      import com.sun.jarsigner.*;
      public class X extends ContentSigner {
          @Override
          public byte[] generateSignedData(ContentSignerParameters parameters,
                  boolean omitContent, boolean applyTimestamp) {
              return "1234".getBytes();
          }
      }
      c $ javac --release 8 X.java
      X.java:2: error: cannot find symbol
      public class X extends ContentSigner {
                             ^
        symbol: class ContentSigner
      X.java:4: error: cannot find symbol
          public byte[] generateSignedData(ContentSignerParameters parameters,
                                           ^
        symbol: class ContentSignerParameters
        location: class X
      X.java:1: error: package com.sun.jarsigner does not exist
      import com.sun.jarsigner.*;
      ^
      X.java:3: error: method does not override or implement a method from a supertype
          @Override
          ^
      4 errors

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jlahoda Jan Lahoda
              Reporter:
              weijun Weijun Wang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: