Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keytool error bash: keytool: command not found

I have tried to execute keytool from Java bin directory but I get an error with warning bash: keytool: command not found.

root@xxxxxx]# keytool -genkey -alias mypassword -keyalg RSA  bash: keytools: command not found 
like image 615
user217929 Avatar asked May 02 '13 08:05

user217929


People also ask

How do I fix Keytool error?

The SolutionChange the directory and file access permission to allow you to access the file. If change access permission does not solve the problem, launch the Command Prompt as an administrator. Right click on Command Prompt and select “Run as administer”.

Where is Keytool on Linux?

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 run a Keytool command?

In the command prompt, invoke the keytool utility: (For Microsoft Windows) Type keytool.exe and press Enter. (For UNIX) Type keytool and press Enter. You can use the keytool utility from Oracle JDK Java 1.5 or 1.6.


1 Answers

These are the steps which solved my problem:

  • Search the path where my java was installed

    find / -name jre 
  • Move to java directory (where jre was installed on my server)

    cd /path/to/jre/bin 
  • Create SSL certificate with keytool command

    ./keytool -genkey -alias [mypassword] -keyalg [RSA] 
like image 197
user217929 Avatar answered Sep 24 '22 21:09

user217929