Building Keytool on Windows
May 3, 2021 ยท View on GitHub
This document describes building keytool with MSYS2 and its usage on Windows 10 64-bit.
Installing MSYS2 and Packages
- Install
MSYS2by downloading the installer and following the installation guide in www.msys2.org. - Run
MSYS2and make sure the package database is updated:
# pacman -Syu
# pacman -Su
- Next, install the compiler and the required packages:
# pacman --noconfirm -S mingw-w64-x86_64-clang patch git make mingw-w64-x86_64-libc++ autoconf automake1.8 libtool automake python
Compiling Keytool
- Clone
keytool-cli, e.g. intoC:\msys64\home - Open
MSYS2 MinGW 64-bitapplication andcdintoC:\msys64\home\keytool-cli - Run the build script with:
# export CC="clang" && export CXX="clang++" && ./build.sh
- Install:
# make install
You can now freely use keytool inside MSYS2 MinGW 64-bit console.
Running Keytool as a Native Windows App
To be able to use keytool as a native app on Windows outside msys2/mingw64, you have to expose four files to the system: keytool.exe, libc++.dll, libunwind.dll and libssp-0.dll, which all reside in C:\msys64\mingw64\bin.
To do so, add that folder to the Windows PATH by the following command in Windows Cmd:
> set PATH=%PATH%;C:\msys64\mingw64\bin
That's it. Now you can use keytool as a native Windows app in the Windows command-line tool.