title: Signing java 11 jar with jarsigner duplicate entry module-info.class
body: <p>Hi I am new with java modules so this might be a dumb question.</p>
  
  <p>I was trying to sign my jar file with keystore and got the following error.</p>
  
  <pre><code>user@Ubuntu:libs(master)$ jarsigner -keystore keyStoreFileName Test.jar alias
  Enter Passphrase for keystore: 
  jarsigner: unable to sign jar: java.util.zip.ZipException: duplicate entry: module-info.class
  </code></pre>
  
  <p>I couldn't find any documentation of how to avoid this. </p>
  
  <p>So I did jar -tf to check the content of the jar and yes, it does have multiple module-info.class files</p>
  
  <p>Is there any option to combine them? and how?</p>
  
  <p>my module-info.java contains the following. </p>
  
  <pre><code>module module_name {
      requires java.desktop;
      requires java.prefs;
      requires javafx.controls;
      requires javafx.fxml;
      requires javafx.web;
      requires org.jsoup;
      opens com.test.apps to javafx.fxml;
      exports com.test.apps;
  }
  </code></pre>
  
  <p>and I am creating jar with gradle like this</p>
  
  <pre><code>jar {
      manifest {
          attributes 'Main-Class': 'com.test.apps.Main'
          attributes 'Application-Name': 'Test'
      }
  
      from {
          configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
      }
  
  }
  </code></pre>
  
  <p>I know I shouldn't post screenshots, but here is the jar opened with archive manager
  <a href="https://i.stack.imgur.com/ipBwT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ipBwT.png" alt="Archive manager screenshot"></a></p>
  
  <p>there are 7 module-info.class files, 1st one generated on 23-Dec-18 (today) rest all are from 05-Nov-18 which I remember upgrading to java 11 that day,</p>
  
  <p>so those are added from my dependencies, how can I integrate them into one class? or are there other option to sign a jar?</p>
  
  <p>again, this is coming from a noob.</p>
  
  <p>[Edit]
  if you are looking for complete source code, it is in GitHub -> <a href="https://github.com/CodingOtaku/Animu-Downloaderu" rel="noreferrer">https://github.com/CodingOtaku/Animu-Downloaderu</a></p>