Is there a way to enable Java only for specific applications?

Solution 1:

There is a way, but it's convoluted and non-intuitive. I will say that I do not recommend this approach, but I am listing it for completeness.

Java Default Policy Administration is the official doc on Java's own internal security and access policy.

The idea is that you can set deny access to files/folders at a global level, then add specific grant permissions to those Java classes/jars you want to allow.

The permission's that can be set are listed in the JDK Permissions

Some examples of what can be done can be found at ExampleDepot