In the code:
System.setProperty(\"javax.net.ssl.trustStore\", cacerts); System.setProperty(\"javax.net.ssl.trustStorePassword\", pwdCacerts); SSLSocketFact
The file you imported (Server.cer) is not in the format java is expecting. You told keytool the format was JCEKS. I believe that means it's a full keystore, which is not likely for a file named Server.cer.
You may have wanted to use -type PKCS12 instead.