This content has been marked as final. Show 12 replies
have you tried navigating to the BIN directory of the JDK (not the JRE) and issue this on the command line? Its a one-time creation so its not too big a burden to navigate to the directory on the command line. I tested your keygen command and it worked
Thsnks for the reply! Still not working and if I enter C:\Program Files........ then the command is not recognised
I am able to navigate to the BIN directory now on the command line. I issue the command C: \Program Files\Java\jdk1.7.0_21\bin - between C: and \ a SPACE. However I am still not winning with the keytool command. I have jdev running plus weblogic plus the emulator and I then do the keytool command and still no way forward
Can you issue the command:
It should be something similar to
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)
Try moving your JDK directory to a path that has no spaces.
Or just go into the bin directory and just type the keytool command there without a path
If you are looking for an alternative without-spaces name for "C:\Program Files\Java\jdk1.7.0_21\jre" you could try the /X option for the dir command which .
So, e.g. it could become "C:\PROGRA~1\Java\jdk1.7.0_21\jre".
C:\>dir /X Program* ... ... <DIR> PROGRA~1 Program Files ... <DIR> PROGRA~2 Program Files (x86) ...
Alternatively, as suggested before in this forum thread:
(tip : You can use "Your Control Panel" to make your name visible in forum posts.)
C:\>cd C:\Program Files\Java\jdk1.7.0_21\bin C:\Program Files\Java\jdk1.7.0_21\bin>keytool ...
Yeah I can
Yeah I just did it reads
java version "1.7.0_21"
Java<TM> SE Runtime Environment <build 1.7.0_21-b11>
Java Hotspot<TM> Client VM <build 23.21-b01, mixed mode, sharing>
Thanks! Just the keytool command without a path shuts down cmd. Navigating to the bin directory is not the problem I guess. I issued the command C:\Program Files\Java\jdk1.7.0_21\bin and the message displayed reads <'C:\Program' is not recognised as an internal or external command, operable program or batch file> However I set the System Varaiable PATH to C:\Program Files\Java\jdk1.7.0_21\bin and then issue the command PATH>keytool -genkey....... and then PATH is recognised. The alternative was on the command line I enter C: \Program Files\Java\jdk1.7.0_21\jre\bin>keytool -genkey....... a SPACE between C: and \ then the error message <'C:\Program' is not recognised as an internal or external command, operable program or batch file> doesn't pop up. The real problem is the command <keytool -genkey........> I am not winning there, the cursor just comes back to "C:\Windows\system32>"
992980 wrote:Note that the documentation "Example 17-1 Generating a Keystore"
... The real problem is the command <keytool -genkey........> I am not winning there, the cursor just comes back to "C:\Windows\system32>" ...
has "Tip: Use the -genkeypair instead of the -genkey command for Java Platform Standard Edition (Java SE) 7."
When starting a Command Prompt as administrator on Windows 7, the following worked for me:
C:\oracle\jdevstudio111240-mw\jdk160_24\bin>keytool -genkeypair -v -keystore C:/my-keystore-name.keystore -alias my-alias-name -keyalg RSA -keysize 2048 -validity 10000 -dname cn=mycn -keypass welcome1 -storepass welcome1
Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with
a validity of 10,000 days
If I try the same in a Command Prompt not started as administrator, I get:
"keytool error: java.io.FileNotFoundException: C:\my-keystore-name.keystore (Access is denied)"
Thanks Jan! And profoundly appreciate your help. Let me work through this.
If you insist on having the JDK in a directory that has a path you'll need to surround your path with ""1 person found this helpful
"C: \Program Files\Java\jdk1.7.0_21\jre\bin\keytool"
By the way, I'm not sure a JRE is enough - I think you might need a full JDK.