N/APosted on - 06/27/2019
While executing my program in java, I encountered an error saying SunCertPathBuilderException. How can I deal with this exception since it’s hindering the execution of the whole program? How can I fix this error permanently?
SunCertPathBuilderException: Unable To Find Valid Certification Path To Requested Target
If you receive this exception, there is no valid certificate from an authorized CA on the Web server or URL to which you are connecting. This solution shows how to create an approved keystore to resolve this issue. Download the Sun InstallCert.java utility to add the server certificate to the keystore and then compile the same to create .class files using “javac InstallCert.java”.Run the InstallCert class with your domain name and press Enter when prompted. It adds the domain you requested as the trusted keystore and creates a file named jssecacerts. Move the jssecacerts file to the $ JAVA_HOME \ jre \ lib \ security folder. Now that your problem is resolved, you will no longer receive this exception.