This post is older than a year. Consider some information might not be accurate anymore.
To achieve that we convert the certificate into a binary cert that can be imported by the Java keytool.
First, convert your certificate in a DER format :
openssl x509 -outform der -in certificate.pem -out certificate.der
And after that, import it in the keystore :
keytool -import -alias your-alias -keystore cacerts -file certificate.der