user2824073
user2824073

Reputation: 2485

Update JAR libraries under Java\jre7\lib\security


I have an application which uses unlimited JCE API. In order to get it working I had to copy the US_export_policy.jar and local_policy.jar under the Java\jre7\lib\security. Unfortunately on some machines I don't have the rights to overwrite the JRE files. Is it possible to override the default libs passing them as JVM boot parameter ? (bootclasspath for example) or even Programmatically ? Thanks

Upvotes: 1

Views: 239

Answers (1)

Francesco Marchioni
Francesco Marchioni

Reputation: 4338

If you are looking for a Programmatic solution, the following one will work:

try { 
Field field = Class.forName("javax.crypto.JceSecurity").
getDeclaredField("isRestricted");
field.setAccessible(true);
field.set(null, java.lang.Boolean.FALSE); 
} catch (Exception ex) {
ex.printStackTrace();
}

regards

Upvotes: 1

Related Questions