4 Replies Latest reply: Jan 15, 2012 12:06 PM by sabre150 RSS

    The .keystore file now cannot be found (No such file or directory)

    911171
      hi,

      so, I'm trying to sign a JAR file connected to an applet.

      I got to creating the keystore and had a "where do you want to store it? and what do you want to call it?" messages.

      I saved it as '.keystore' and was warned by the system that files beginning with '.' are invisible.

      I clicked ok (thinking the compiler should be able to 'see' it) and now whenever I try to sign anything the Terminal tells me:

      jarsigner error: java.lang.RuntimeException: keystore load: /Users/spikenigma/.keystore (No such file or directory)

      It doesn't matter how many other keystores I create, it looks for it in said directory and throws up an error.

      I've tried everything

      HELP
        • 1. Re: The .keystore file now cannot be found (No such file or directory)
          sabre150
          The chances are that your .keystore is not being created in the directory you think it is. To prove or disprove you could provide a full path and not just the relative path. You could also search your had disk for a ".keystore" file and you could try giving the keystore a name that does not start with a period.

          P.S. The compiler does not look for the keystore file; the jar signing tool does.
          P.P.S. You haven't tried everything since you have not tried providing the full path or searching for the ".keystore' file.
          • 2. Re: The .keystore file now cannot be found (No such file or directory)
            911171
            Ok, I'll be as specific as possible and maybe you can tell where I am going wrong. I am on a Mac.

            1)

            I have a JAR file called csvjdbc.jar . It is a driver that enables offline SQL operations of sorts on tabular data.

            It works perfectly when loaded in the classpath both dynamically and at runtime.

            The contents of it's manifest file are, as expected:

            Manifest-Version: 1.0
            Ant-Version: Apache Ant 1.8.1
            Created-By: 1.6.0_22-b04 (Sun Microsystems Inc.)


            2)

            A test of csvjdbc.jar to check if it is already signed returns that it is not, as expected:

            (input)
            jarsigner -verify csvjdbc.jar
            (input)

            (output from terminal)
            jar is unsigned. (signatures missing or not parsable)
            (output from terminal)


            3)

            I want to sign the jar file so that I can load said JAR file in an applet I have not yet created.

            4)

            My steps are:

            (navigate to the folder via the terminal)
            cd desktop
            cd progamming
            cd java
            etc….
            (navigate to the folder via the terminal)


            (try to sign the jar)
            jarsigner csvjdbc.jar spikenigma
            (try to sign the jar)


            (response from terminal)
            Enter Passphrase for keystore:
            (response from terminal)

            (entered passphrase)
            ************** (censored)
            (entered passphrase)

            (response from terminal as previously mentioned)
            /Users/spikenigma/.keystore (No such file or directory)
            (response from terminal as previously mentioned)


            (Ok, let's create another keystore in a different location)
            keytool -genkey -alias signFiles -keystore thekeystore
            (Ok, let's create another keystore in a different location)


            (answer standard questions)
            Enter keystore password:
            Re-enter new password:
            What is your first and last name?
            What is the name of your organizational unit?
            What is the name of your organization?
            What is the name of your City or Locality?
            What is the name of your State or Province?
            What is the two-letter country code for this unit?
            (answer standard questions)


            (so, we try signing again)
            jarsigner csvjdbc.jar spikenigma
            (so, we try signing again)

            (enter the passphrase)
            Enter Passphrase for keystore:
            (enter the passphrase)

            (response from terminal as previously mentioned)
            jarsigner error: java.lang.RuntimeException: keystore load: /Users/spikenigma/.keystore (No such file or directory)
            (response from terminal as previously mentioned)
            • 3. Re: The .keystore file now cannot be found (No such file or directory)
              911171
              Sorry, should add that:

              I should not have said compiler.

              I've also done a full search for the .keystore file (that as I said the system warned me would be invisible) and have not come up with anything.

              I have made all invisible files visible as a test via the terminal and it still does not come up.

              I can also see the other keystores I have created, but cannot sign the jar file using them.

              Edited by: 908168 on Jan 15, 2012 9:21 AM
              • 4. Re: The .keystore file now cannot be found (No such file or directory)
                sabre150
                You have not posted the command you used to create the key store or the command you used to sign the jar.

                Note - manifest file you have posted shows no evidence of the jar file being signed.