Setting Truststore
Answered
Hello,
for some resons IntelliJ has problems with my trust store. My truststore is cacert - and there I added all my certificates, this I have confirmed. However IntelliJ is telling me that the main class Djavax.net.ssl.truststore=trust.jks can not be found. How do I tell IntelliJ to use my cacert by default.
Thanks a lot in advance
Daniel
Please sign in to leave a comment.
Please clarify the problem. Post the screenshot of the error and describe when do you get. How can one reproduce it?
Well - the output is in german. But thats the only thing I have. I don't know how to reproduce it. I just run maven then it says: Error: Main class Djavax.net.ssl.truststore=trust.jks could not be found or loaded. The weird thing is - on eclipse it works, and I have no clue why.
Where do you specify this JVM option? It looks like you forgot "-", it should be "-Djavax.net.ssl.truststore=trust.jks".
This is the weird thing - I don't do it in IntelliJ at all . I am sorry, I just switched to IntelliJ, checked out the code and I am confused.
Do Find in Path: https://www.jetbrains.com/help/idea/2016.3/find-and-replace-in-path.html.
Search for "Djavax.net.ssl.truststore=trust.jks" string.
Probably it comes from pom.xml jvmArgs.
I did what you proposed however I did not find anything. And this is not project specific ... all projects have the same problem. Where can I change the default truststore to cacert ?
Please upload the project so that we can find what's wrong: https://intellij-support.jetbrains.com/hc/articles/206869619.
Sorry I cant do that
But where can I set the default truststore
Check system environment variables in case some global Java variables are set incorrectly there.
Search IDE config folder for this string (https://intellij-support.jetbrains.com/hc/articles/206544519).
1) keep cacerts in in C:\xx\java.cacerts
Note the VM args : -Djavax.net.ssl.trustStore=C:\xx\java.cacerts -Djavax.net.ssl.trustStorePassword=xxxxxxx
2) You should pass vm args as mentioned below in 2 places
a)File>Settings>.....>Maven>Importing>Vm Options for importer
b)File>Settings>....>Maven>Runner>VM Options
This will let your IntelliJ to use those certs while running maven build or import.