I am trying to discover the list of trusted authorities in my Java Runtime using the instructions in this article . When I typed the command below:
C:\ColdFusion8\runtime\jre\lib>keytool -list -storepass changeit -noprompt -keystore
I got the following error:
'keytool' is not recognized as an internal or external command, operable program or batch file.
I checked that the directory containing my keytool executable is in the path. (On my Windows 7 machine, it's in C:\Program Files (x86)\Java\jre6\bin
) Despite this, the command line will not recognise the keytool
command.
I'm assuming that there are two separated commands mentioned in the doc:
C:\CFusionMX\runtime\jre\lib>keytool -list -storepass changeit -noprompt -keystore
C:\CFusionMX\runtime\jre\lib\security\cacerts
EDIT:
By the way can I use the following process instead of complex steps mentioned in the answer?
Then I clicked on "Install Certificate" option
A Certificate Import Wizard window opened, I clicked on Next I saw two options
I decided to select option (b)
, but I'm confused which certificate store I should select here.
Add your JDK's /bin folder to the PATH
environmental variable. You can do this under System settings > Environmental variables, or via CLI:
set PATH=%PATH%;C:\\Program Files\\Java\\jdk1.7.0_80\\bin
Close and reopen your CLI window
You are getting that error because the keytool
executable is under the bin
directory, not the lib
directory in your example. And you will need to add the location of your keystore
as well in the command line. There is a pretty good reference to all of this here - Jrun Help / Import certificates | Certificate stores | ColdFusion
The default truststore is the JRE's cacerts file. This file is typically located in the following places:
Server Configuration:
cf_root/runtime/jre/lib/security/cacerts
Multiserver/J2EE on JRun 4 Configuration:
jrun_root/jre/lib/security/cacerts
Sun JDK installation:
jdk_root/jre/lib/security/cacerts
Consult documentation for other J2EE application servers and JVMs
The keytool is part of the Java SDK and can be found in the following places:
Server Configuration:
cf_root/runtime/bin/keytool
Multiserver/J2EE on JRun 4 Configuration:
jrun_root/jre/bin/keytool
Sun JDK installation:
jdk_root/bin/keytool
Consult documentation for other J2EE application servers and JVMs
So if you navigate to the directory where the keytool
executable is located your command line would look something like this:
keytool -list -v -keystore JAVA_HOME\jre\lib\security\cacert -storepass changeit
You will need to supply pathing information depending on where you run the keytool command from and where your certificate file resides.
Also, be sure you are updating the correct cacerts file that ColdFusion is using. In case you have more than one JRE installed on that server. You can verify the JRE ColdFusion is using from the administrator under the 'System Information'. Look for the Java Home line.
以管理员身份运行CMD 这对我有用
Execute following command:
set PATH="C:\\Program Files (x86)\\Java\\jre7"
(whichever JRE
exists in case of 64bit).
Because your Java Path is not set so you can just do this at command line and then execute the keytool
import command.
I finally solved the problem!!! You should first set the jre path to system variables by navigating to::
control panel > System and Security > System > Advanced system settings
Under System variables click on new
Variable name: KEY_PATH
Variable value: C:\Program Files (x86)\Java\jre1.8.0_171\bin
Where Variable value should be the path to your JDK's bin folder.
Then open command prompt and Change directory to the same JDK's bin folder like this
C:\Program Files (x86)\Java\jre1.8.0_171\bin
then paste,
keytool -list -v -keystore "C:\Users\user\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
NOTE: People are confusing jre and jdk. All I did applied strictly to jre
A simple solution of error is that you first need to change the folder directory in command prompt. By default in command prompt or in terminal(Inside Android studio in the bottom)tab the path is set to C:\\Users#Name of your PC that you selected\\AndroidStudioProjects#app name\\flutter_app> Change accordingly:- C:\\Users#Name of your PC that you selected\\AndroidStudioProjects#app name\\flutter_app>cd\\
Make sure JAVA_HOME is set and the path in environment variables. The PATH should be able to find the keytools.exe
Open “Windows search” and search for "Environment Variables"
Under “System variables” click the “New…” button and enter JAVA_HOME as “Variable name” and the path to your Java JDK directory under “Variable value” it should be similar to this C:\\Program Files\\Java\\jre1.8.0_231
此链接提供了“'keytool' 未被识别为内部或外部命令”问题的完整描述和解决方案:点击此链接: https : //codewithandrea.com/articles/keytool-command-not-found-how- to-fix-windows-macos/这对我有用
I tried all the solutions above and didn't work. here's what I did, first I defined all the right paths in Path windows; didn't work. instead I defined them in Android terminal like this: first open up a local
terminal and go to the setting like this:
after that click on environment variable in the setting like this:
and set the actual variable there like this:
after that click all the OK
buttons and type keytool
in the terminal. should do fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.