List of usage examples for java.lang SecurityManager checkExec
public void checkExec(String cmd)
SecurityException
if the calling thread is not allowed to create a subprocess. From source file:Main.java
public static void main(String[] args) { System.setProperty("java.security.policy", "file:/C:/java.policy"); SecurityManager sm = new SecurityManager(); System.setSecurityManager(sm); // perform the check sm.checkExec("notepad.exe"); System.out.println("Allowed!"); }