Setting System property for the JVM
- From: Lakshmi Ashok <lakshmi2510@xxxxxxxxx>
- Date: Mon, 11 Feb 2008 20:43:09 -0800 (PST)
I am retrieving emails from a mail box using pop3 over SSL. For that
purpose I am setting a truststore variable as a system property.
<code>
System.clearProperty("javax.net.ssl.trustStore");
Properties p = new Properties(System.getProperties());
p.put("javax.net.ssl.trustStore", "C:\\cacerts");
System.setProperties(p);
<code>
Everything works fine.
But lets say that, in my current executing thread, this parameter
needs to be altered runtime, to, Say a file in a non-existing folder,
<code>
System.clearProperty("javax.net.ssl.trustStore");
Properties p = new Properties(System.getProperties());
p.put("javax.net.ssl.trustStore", "C:\\certificates\\cacerts");
System.setProperties(p);
<code>
And, also that I delete the C:\\cacerts file to make sure the new path
is picked up...
The program fails !
I see that this property is being set only once for that JVM instance.
Any subsequent modification is not being considered.
Is this how this was designed?
.
- Follow-Ups:
- Re: Setting System property for the JVM
- From: Sabine Dinis Blochberger
- Re: Setting System property for the JVM
- Prev by Date: Re: Float.MIN_VALUE
- Next by Date: Rounding doubles
- Previous by thread: Re: Float.MIN_VALUE
- Next by thread: Re: Setting System property for the JVM
- Index(es):
Relevant Pages
|