How to convert PEM to JKS

First convert to PCKS12

 openssl pkcs12 -export -in cert.pem -inkey key.pem -out cert.p12 -name "cert"

Import PCKS12 to JKS

keytool -importkeystore -srckeystore cert.p12 -srcstoretype pkcs12 -destkeystore cert.jks