Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse : clientBuilder.sslSocketFactory not supported on JDK 9+

I'm getting this error on Eclipse oxygen 4.7.0, java 1.8

clientBuilder.sslSocketFactory not supported on JDK 9+

related to Eclipse, maven ..trying to update Maven : Alt+f5 the module okhttp3 trying to connect .. when resolving/processing pom

I dont have JDK9 at all. Looked at all the other similar reports on stackoverflow, none is related.

like image 822
sten Avatar asked May 19 '20 19:05

sten


4 Answers

You can find a similar issue in Eclipse bug 517113, with JDK8.

The error call stack indicates an external dependencies to a library compiled with OpenJDK

As seen here, check also your JDK declaration in your Eclipse

I changed code which was using JAVA_HOME as JRE coming with SonarScanner package.
Once I changed it to default JAVA_HOME, it started working fine.

Other possible cause: wrong dependency, as show by PR 3066 or this question.

like image 101
VonC Avatar answered Nov 20 '22 18:11

VonC


I think you are running Eclipse Oxygen with JDK 9.

If you don't want to, then I have a solution for that.

Update the eclipse/eclipse.ini by adding -vm parameter:

-startup
plugins/org.eclipse.equinox.launcher_1.5.0.v20180512-1130.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.700.v20180518-1200
-product
org.eclipse.epp.package.jee.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:/Program Files/Java/jdk1.8.0_251/bin
-vmargs
-Dosgi.requiredJavaVersion=1.8
[email protected]/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx1024m
--add-modules=ALL-SYSTEM

This .ini file is from my latest eclipse. It may be different for other versions.

This will enforce eclipse to start with the JDK that you have added.

Note: -Dosgi.requiredJavaVersion=1.8 will give you information upto which java version the eclipse can support.

like image 33
Anish B. Avatar answered Nov 20 '22 19:11

Anish B.


If anyone has come to face this issue when running Azul's zulu8 open jdk, try by taking zulu8 jdk of say 3-4 versions behind the latest. That worked for me.

like image 1
Mehul Goel Avatar answered Nov 20 '22 17:11

Mehul Goel


Check your OkHttpClient.Builder(), change code from

sslSocketFactory(SSLSocketFactory sslSocketFactory)

to

sslSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager)

For example:

// define sslContext ...

new OkHttpClient.Builder().sslSocketFactory(sslContext.getSocketFactory(), new JEEX509TrustManager()).build();

And then everything will be ok.

like image 1
dallaslu Avatar answered Nov 20 '22 19:11

dallaslu