Before you being ensure that openjdk is installed. At the time of this java-1.8.0-openjdk is the current version on CentOS 7.5
yum install java-1.8.0-openjdk -y
Ensure you have your certificate and private key on the system you are running these commands.