Edit :- Tried to format the question and accepted answer in more presentable way at mine Blog
Here is the original issue.
For MacOS X below is the exact command worked for me where I had to try with double hypen in 'importcert' option which worked :
sudo keytool -–importcert -file /PathTo/YourCertFileDownloadedFromBrowserLockIcon.crt -keystore /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre/lib/security/cacerts -alias "Cert" -storepass changeit