Can the program generate a random "secret" exit code on start up instead of hardcoding it?
Type: Posts; User: Norm
Can the program generate a random "secret" exit code on start up instead of hardcoding it?
No, I don't think I have.
Other that changes to the .java.policy file.
It's no problem for my code.
My app is for my use. It's for executing a number of my other apps on a single JVM. All the other apps exit with 0 so no problem. I wanted to be able to execute any of my apps with this one program...
Can the checkExit method change the value being issued by the master app?
What if your code uses a "secret" exit code?
Write the code, execute it and see what happens. See what values are available that will tell you what you want to know.
I extended SecurityManager and overrode the checkExit() method for my application.
It throws an exception:
throw new SecurityException("ExecuteJava - ignoring exit!");
Here's a small starting point, maybe:
I have a small app that uses a Security Manger to prevent the programs it executes from doing a System.exit(0)
It uses this call to set the Security manager:
...