title: error when creating a keystore => Exception in thread "main" java.io.EOFException at java.io.DataInputStream.readInt(Unknown Source)
body: <p>the source code that I followed to create a keystore, </p>
  
  <pre><code>import java.io.File;
  import java.io.FileInputStream;
  import java.security.KeyStore;
  import java.security.cert.Certificate;
  
  public class MainClass {
  
  public static void main(String args[]) throws Exception {
  String pass = "wshr.ut";
  String alias = "mytest";
  String name = "mykeystore";
  
  FileInputStream in = new FileInputStream(name);
  KeyStore ks = KeyStore.getInstance("JKS");
  ks.load(in, pass.toCharArray());
  
  Certificate c = ks.getCertificate(alias);
  in.close();
  System.out.println(c);
  
  }
  }
  </code></pre>
  
  <p>error when running:</p>
  
  <pre><code>Exception in thread "main" java.io.EOFException
  at java.io.DataInputStream.readInt(Unknown Source)
  at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
  at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
  at java.security.KeyStore.load(Unknown Source)
  at MainClass.main(MainClass.java:17)
  </code></pre>
  
  <p>can you plz give me any ideas or solutions to reslove this problem ?</p>