Keytool is not recognized as an internal command

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:

  1. C:\CFusionMX\runtime\jre\lib>keytool -list -storepass changeit -noprompt -keystore

  2. 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?

  1. When I opened the WSDL into my browser, I saw the Lock icon, when I clicked on it a "Certificate" window opened
  2. Then I clicked on "Install Certificate" option

  3. A Certificate Import Wizard window opened, I clicked on Next I saw two options

    • a) Automatically select the certificate store based on the type of certificate (this option was selected automatically)
    • b) Place all certificates in the following store

I decided to select option (b), but I'm confused which certificate store I should select here.

This question is tagged with java coldfusion keytool

~ Asked on 2013-10-17 16:06:55

The Best Answer is


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.

~ Answered on 2013-10-17 16:18:04


  1. 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
    
  2. Close and reopen your CLI window

~ Answered on 2016-10-17 13:26:10


Most Viewed Questions:

  • what is the most efficient way of counting occurrences in pandas?
  • CSS height 100% percent not working
  • How do I schedule jobs in Jenkins?
  • WAMP/XAMPP is responding very slow over localhost
  • Warning: require_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0
  • Why do I need to explicitly push a new branch?
  • When to use pthread_exit() and when to use pthread_join() in Linux?
  • How to call Base Class's __init__ method from the child class?
  • How can I test an AngularJS service from the console?
  • Adding Multiple Values in ArrayList at a single index
  • Python OpenCV2 (cv2) wrapper to get image size?
  • Add empty columns to a dataframe with specified names from a vector
  • Logout button php
  • How to create a laravel hashed password
  • swift How to remove optional String Character
  • JPA COUNT with composite primary key query not working
  • "Cannot verify access to path (C:\inetpub\wwwroot)", when adding a virtual directory
  • How can I open a .db file generated by eclipse(android) form DDMS-->File explorer-->data--->data-->packagename-->database?
  • Print "hello world" every X seconds
  • How to change the Spyder editor background to dark?
  • How to show current time in JavaScript in the format HH:MM:SS?
  • Create a Maven project in Eclipse complains "Could not resolve archetype"
  • How to: "Separate table rows with a line"
  • How does the getView() method work when creating your own custom adapter?
  • How to consume REST in Java
  • Google Maps API OVER QUERY LIMIT per second limit
  • Python "TypeError: unhashable type: 'slice'" for encoding categorical data
  • Byte Array to Hex String
  • Remove duplicated rows using dplyr
  • Get week number (in the year) from a date PHP
  • How do I concatenate strings and variables in PowerShell?
  • What does random.sample() method in python do?
  • How to replace all spaces in a string
  • Change / Add syntax highlighting for a language in Sublime 2/3
  • What is the difference between a candidate key and a primary key?
  • Permissions for /var/www/html
  • Select Row number in postgres
  • How to print variables without spaces between values
  • error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' -- Missing /var/run/mysqld/mysqld.sock
  • jQuery: serialize() form and other parameters
  • 'mvn' is not recognized as an internal or external command, operable program or batch file
  • How do I validate a date string format in python?
  • Android runOnUiThread explanation
  • CSS :selected pseudo class similar to :checked, but for <select> elements
  • How to find out the MySQL root password
  • Black transparent overlay on image hover with only CSS?
  • Using event.target with React components
  • Unable to load DLL 'SQLite.Interop.dll'
  • How do you revert to a specific tag in Git?
  • How can I update my ADT in Eclipse?
  • Collision resolution in Java HashMap
  • ADB.exe is obsolete and has serious performance problems
  • How to include file in a bash shell script
  • Shuffle DataFrame rows
  • Setting value of active workbook in Excel VBA
  • ES6 Class Multiple inheritance
  • Execute action when back bar button of UINavigationController is pressed
  • If condition inside of map() React
  • "Object doesn't support this property or method" error in IE11
  • Adding Permissions in AndroidManifest.xml in Android Studio?
  • Passing headers with axios POST request
  • JavaScript onclick redirect
  • ASP.NET Temporary files cleanup
  • Dynamic Web Module 3.0 -- 3.1
  • Bootstrap tab activation with JQuery
  • Java - Including variables within strings?
  • Understanding [TCP ACKed unseen segment] [TCP Previous segment not captured]
  • JavaFX open new window
  • javax.net.ssl.SSLException: Read error: ssl=0x9524b800: I/O error during system call, Connection reset by peer
  • Create an enum with string values
  • What is the optimal way to compare dates in Microsoft SQL server?
  • Plotting multiple time series on the same plot using ggplot()
  • Ubuntu: Using curl to download an image
  • Spring Boot and multiple external configuration files
  • What is the fastest way to transpose a matrix in C++?
  • get keys of json-object in JavaScript
  • How to fix IndexError: invalid index to scalar variable
  • Changing the background color of a drop down list transparent in html
  • How to get the caller class in Java
  • Read file content from S3 bucket with boto3
  • Custom toast on Android: a simple example
  • I just assigned a variable, but echo $variable shows something else
  • How to Create a script via batch file that will uninstall a program if it was installed on windows 7 64-bit or 32-bit
  • @POST in RESTful web service
  • Updating javascript object property?
  • Storing an object in state of a React component?
  • how to resolve DTS_E_OLEDBERROR. in ssis
  • getch and arrow codes
  • No Application Encryption Key Has Been Specified
  • TypeError: expected a character buffer object - while trying to save integer to textfile
  • How to join on multiple columns in Pyspark?
  • php exec() is not executing the command
  • Cannot call getSupportFragmentManager() from activity
  • Class extending more than one class Java?
  • Simulate a button click in Jest
  • Move_uploaded_file() function is not working
  • adding comment in .properties files
  • Paritition array into N chunks with Numpy
  • Parse JSON from HttpURLConnection object
  • Change value of variable with dplyr
  • How to hide form code from view code/inspect element browser?
  • Hive query output to file
  • Is there a "standard" format for command line/shell help text?
  • How can I use pickle to save a dict?
  • TypeError: $.browser is undefined
  • What is the symbol for whitespace in C?
  • ajax jquery simple get request
  • The point of test %eax %eax
  • latex tabular width the same as the textwidth
  • CSS3 transition on click using pure CSS
  • Failed to authenticate on SMTP server error using gmail
  • How to import large sql file in phpmyadmin
  • $(document).on('click', '#id', function() {}) vs $('#id').on('click', function(){})
  • comparing elements of the same array in java
  • How to clear exisiting dropdownlist items when its content changes?
  • js 'types' can only be used in a .ts file - Visual Studio Code using @ts-check
  • Add a column in a table in HIVE QL
  • Python foreach equivalent
  • How to check if running as root in a bash script
  • JS. How to replace html element with another element/text, represented in string?
  • How do I set the maximum line length in PyCharm?
  • What is the most efficient way to create a dictionary of two pandas Dataframe columns?
  • no sqljdbc_auth in java.library.path
  • No 'Access-Control-Allow-Origin' header is present on the requested resource—when trying to get data from a REST API
  • Writing to a new file if it doesn't exist, and appending to a file if it does
  • Margin between items in recycler view Android
  • How to calculate the sentence similarity using word2vec model of gensim with python
  • The proxy server received an invalid response from an upstream server
  • Use Awk to extract substring
  • HTML5 Video // Completely Hide Controls
  • Refused to load the font 'data:font/woff.....'it violates the following Content Security Policy directive: "default-src 'self'". Note that 'font-src'
  • JSON.parse unexpected token s
  • Docker can't connect to docker daemon
  • How to add an image in the title bar using html?
  • Where Sticky Notes are saved in Windows 10 1607
  • Git merge with force overwrite
  • How can you print multiple variables inside a string using printf?
  • How to use executables from a package installed locally in node_modules?
  • How to check if ZooKeeper is running or up from command prompt?
  • Modulo operation with negative numbers
  • Create Pandas DataFrame from a string
  • UTF-8 in Windows 7 CMD
  • Take n rows from a spark dataframe and pass to toPandas()
  • Maven: How to run a .java file from command line passing arguments
  • Best way to disable button in Twitter's Bootstrap
  • EXCEL VBA Check if entry is empty or not 'space'
  • JSONDecodeError: Expecting value: line 1 column 1
  • Longer object length is not a multiple of shorter object length?
  • How to use sudo inside a docker container?
  • SQL state [99999]; error code [17004]; Invalid column type: 1111 With Spring SimpleJdbcCall

How do you fix Keytool is not recognized as an internal or external command?

all you have to do is go to environment variables, click PATH to make it active, then click edit, then add complete path where your keytool is, for me i will add C:\Program Files\Java\jre7\bin this will allow you to execute keytool commands without going to the directory where keytool is installed.

How do I fix Keytool not found?

Add the keytool folder to your system PATH (on Windows) In order to run keytool from the command line, you need to add it to your system PATH. This step is required on Windows only, as keytool will is automatically installed on /usr/bin on macOS/Linux.

How do I enable Keytool?

To get android key hash code follow these steps (for facebook apps).
Download the openssl for windows here..
now unzip to c drive..
open cmd prompt..
type cd C:\Program Files\Java\jdk1.6.0_26\bin..

How do I run a Keytool in Linux?

For keytool and jarsigner(1), you can specify a keystore type at the command line, via the -storetype option. For Policy Tool, you can specify a keystore type via the "Change Keystore" command in the Edit menu.