Send JavaMail via Gmail from within IntelliJ

Answered

How can I send JavaMail via the Gmail server?

I get this error: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

IntelliJ says to have an own trusted certificates store. Correct?

So I tried to a server certificate via File | Settings | Tools | Server Certificates. Is this the right place to store the Gmail Certificate?

I tried adding by ... going to Gmail > clock on the lock-icon > going to the certificate details > export to a .Crt file > importing it via the above IntelliJ import description.

Still the JavaMail application complains about the PKIX path issue. Why?

0
1 comment

You should add the certificate to the JVM used to run your app via keytool. The issue is not related to IntelliJ IDEA.

0

Please sign in to leave a comment.