title: Error while creating multi release jar "entry: A.class, contains a class with internal name com.vipin.exp.A, names do not match"
body: <p>Here java9/com/vipin/exp/A.class is file I want to use with jdk 9 and for other versions java8/com/vipin/exp/A.class. For this I am trying to create multi release jar but getting below error. What is wrong in this command ?</p>
  
  <pre><code>XXXX@XXX-MacBook-Air.local:~/javacode$ pwd
      /Users/XXXX/javacode
  XXXX@XXX-Air:~/javacode$ javac --release 9 -d /Users/nitinkumarsharma/javacode/java9/ java9/com/vipin/exp/A.java
  XXXX@XXX-Air:~/javacode$ javac --release 8 -d /Users/nitinkumarsharma/javacode/java8/ java8/com/vipin/exp/A.java
  XXXX@XXX-Air:~/javacode$ jar -c -f vipin.jar -C java8/com/vipin/exp/ . --release 9 -C java9/com/vipin/exp/ .
  
          entry: A.class, contains a class with internal name com.vipin.exp.A, names do not match
          entry: META-INF/versions/9/A.class, contains a new public class not found in base entries
          Warning: entry META-INF/versions/9/A.java, multiple resources with same name
          invalid multi-release jar file vipin.jar deleted
  </code></pre>
  
  <p>My directory structure is:</p>
  
  <pre><code>XXXX@XXX-MacBook-Air.local:~/javacode$ tree
  .
  |____java8
  | |____com
  | | |____vipin
  | | | |____exp
  | | | | |____A.class
  | | | | |____A.java
  |____java9
  | |____com
  | | |____vipin
  | | | |____exp
  | | | | |____A.class
  | | | | |____A.java
  </code></pre>
  
  <p>It works well when I use only one class file to create jar, like below</p>
  
  <pre><code>XXXX@XXX-MacBook-Air.local:~/javacode$ jar -c -f vipin.jar -C java8/com/vipin/exp/ .
  XXXX@XXX-MacBook-Air.local:~/javacode$ ls -ltr
  total 12688
  drwxr-xr-x  3 XXXX  staff      102 Oct 17 18:02 java8
  drwxr-xr-x  3 XXXX  staff      102 Oct 17 20:00 java9
  -rw-r--r--  1 XXXX  staff      968 Oct 18 17:05 vipin.jar
  XXXX@XXX-MacBook-Air.local:~/javacode$ jar -tvf vipin.jar 
       0 Wed Oct 18 17:05:08 IST 2017 META-INF/
      61 Wed Oct 18 17:05:08 IST 2017 META-INF/MANIFEST.MF
     430 Tue Oct 17 22:55:22 IST 2017 A.class
     136 Tue Oct 17 22:49:20 IST 2017 A.java
  </code></pre>