To sign JAR files, you first need to create a keystore, and generate and add key pairs to it. These can be created with Oracle's
keytool utility, that comes built into your Java Runtime Environment (JRE), by executing the following command:
keytool -keystore <keystore filename> -keypass <key_password> -storepass <store_password> -alias <store_alias> \ -genkeypair -dname "cn=<cName>, ou=<orgUnit>, o=<orgName>, S=<stateName>, c=<country>" -validity <days>
For more information, refer to the Oracle keytool - Key and Certificate Management Tool documentation.