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

Jar with signed dependency in it is crashing on main class not found exception

XMLWordPrintable

    • x86_64
    • linux_suse_slec

      A DESCRIPTION OF THE PROBLEM :
      if a jar is built including some signed dependency like bouncy castle bcmail-15on which brings META-INF/BCKEY.DSA into it then the jar is not runnable and it is pain to investigate why, because it incorrectly reports that the main class was not found:

      $ java -jar myjar.jar

      Error: Could not find or load main class com.example.MyMainClass
      Caused by: java.lang.ClassNotFoundException: com.example.MyMainClass

      Once META-INF/BCKEY.DSA is explicitly excluded from the jar by the build system then it starts working

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      see description it is very easy to reproduce



       

            tongwan Andrew Wang
            pnarayanaswa Praveen Narayanaswamy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: