How do I set a custom java trust store so Intellij...
# intellij
a
How do I set a custom java trust store so Intellij would use it? I have set (
-<http://Djavax.net|Djavax.net>.ssl.trustStore=<home>/cacerts -<http://Djavax.net|Djavax.net>.ssl.trustStorePassword=changeit
) in: • JAVA_OPTS env variable • idea.vmoptions • VM options in run still, it's taken from projects java SDK. The IntelliJ IDEA 2025.2.2 (Ultimate Edition), Build #IU-252.26199.169, built on September 18, 2025. updated today, but on previous version, 2025.2.1 the same behaviour. Adding the ssl debug result in:
Copy code
javax.net.ssl|DEBUG|53|DefaultDispatcher-worker-12 @call-context#41|2025-09-19 21:40:47.152 CEST|TrustStoreManager.java:156|Inaccessible trust store: /<path>/.sdkman/candidates/java/<version>/lib/security/jssecacerts
javax.net.ssl|DEBUG|53|DefaultDispatcher-worker-12 @call-context#41|2025-09-19 21:40:47.156 CEST|TrustStoreManager.java:112|trustStore is: /<path>/.sdkman/candidates/java/<version>/lib/security/cacerts
I switch a lot between different sdk, and don't want to import all certs to multiply trust stores.
t
The only way I’ve seen is to set
JDK_JAVA_OPTIONS=-<http://Djavax.net|Djavax.net>.ssl.trustStore=<home>/cacerts
. I’ve tried setting it in various gradle/maven settings as well, but none of those seem to work
Java will complain at you a bunch about that because it’ll be adding that option to every invocation, but it’s the only way I know
a
That actually helped, thank you @Tim Hill 🙏
👍 1
JAVA_OPTS I used on Tomcat since forever, things changed a bit over the years, but still I'd say passing it to IDE
idea.vmoptions
should be recognised. thank you color again.
t
I had some document a while back that I’ve unfortunately lost that was every possible environment variable that one might need for Java/Gradle/Maven across their different versions. It made me feel like:
😆 1