I\'m using a licensed API which has a method to acquire/release a license object from a license server that has a finite number of licenses. At the beginning of my applicati
If the program is terminated through a crash of the JVM, you can't rely on anything being called.
If the program is terminated through an exception that doesn't involve the JVM you should be able to wrap everything in a try/catch/finally block. Any code in the finally block would be guaranteed to run before your code exits.