1

Does anyone know of a clean/elegant way to exit JVM if unlimited encryption is NOT installed? Looking to install a some type of assertion that will exit with clean error when java is executed without required jars installed in <JAVA_HOME>/jre/lib/security

It would be tedious to bake this check in the many Java applications that we deploy.

This question does a good job explaining how to test if unlimited encryption is installed: Checking if Unlimited Cryptography is available

brianNotBob
  • 548
  • 6
  • 9
  • Simle, make a call to `System.exit(0);` or `Runtime.getRuntime().exit(0);` – Chirag Mar 22 '18 at 16:22
  • Java does not have a facility to install global code, i.e. code that runs whenever *any* Java program is started. You must add code to each program to make the test. – Andreas Mar 22 '18 at 16:31
  • I wasn't aware of a mechanism either, but was hopeful someone with deep knowledge of JVM had an idea. You can suspend JVM when remote debugging via `suspend=y`. Was hopeful an agent or something similar could be added for this. – brianNotBob Mar 22 '18 at 18:06

0 Answers0