I have updated java to JDK 19 and when I try opening Eclipse Marketspace i am getting below error,
MarketplaceDiscoveryStrategy failed with an error Cannot complete request to https://marketplace.eclipse.org/api/p?client=org.eclipse.epp.mpc.core&client.version=1.6.4.v20180214-1810&os=win32&ws=win32&nl=en_US&java.version=1.8.0_211&product=org.eclipse.epp.package.java.product&product.version=4.7.3.M20180330-0640&runtime.version=3.13.0.v20170207-1030&platform.version=4.7.3.v20180330-0640: Unable to read repository at https://marketplace.eclipse.org/api/p?client=org.eclipse.epp.mpc.core&client.version=1.6.4.v20180214-1810&os=win32&ws=win32&nl=en_US&java.version=1.8.0_211&product=org.eclipse.epp.package.java.product&product.version=4.7.3.M20180330-0640&runtime.version=3.13.0.v20170207-1030&platform.version=4.7.3.v20180330-0640.
I wanted to Install testNg so I tried adding the certificate as follows and made it trust, Still facing the same issue.
keytool -import -alias TestNg -keystore "C:\Program Files\Java\jdk-19\lib\security\cacerts" -file TestNg.cer
I get below error,
Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Am I missing anything, I don't see a JRE for JDK is that I am missing?
After exploring few I found a solution for this,
The reason behind the error was:
Our cooperate firewall (ZScalar) prevent these additional steps, and install attempts will fail with the below messages:
Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.
Java did not recognize the root certificate authority (CA).
How to fix this?
There are two ways to fix this:
Admin team has to reconfigure the firewall to allow Java access to the certificate sites.(They did not agreed with this, so proceeded with below way).
To verify the root certificates, determine where the cacerts file is located.
Cacerts file is available in eclipse jre folder. For example
C:\Eclipse 2022 09\eclipse-java-2022-09-R-win32-x86_64\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038\jre\lib\security\cacerts
Now the certificate for the software’s needs to be added to this cacerts file. Eclipse marketplace itself was not opening for me. So on browser I pinged the below link,
https://marketplace.eclipse.org/
Click on the HTTPS certificate chain and navigate the certificate hierarchy. At the top there should be a Primary Root CA. This could be missing from my java cacerts file. Export the certificate and saved in my computer. Now imported to cacerts file.
Open cmd where the certificate is expoted. Execute below command.
keytool -import -alias MarketPlace -keystore "C:\Eclipse 2022 09\eclipse-java-2022-09-R-win32-x86_64\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038\jre\lib\security\cacerts" -file ZscalerRootCAMP.der
Here ZscalerRootCAMP.der is the certificate exported for Eclipse market place.
Restart eclipse, open Eclipse marketplace and now I am able to install software's.