I have one runnable JAR file that is scheduled to run independently using Timer .
The same JAR is executed through web application(developed in spring MVC).
I have to restrict the execution of JAR in a situation when if jar is executing through timer then at that time it is not allowed to execute through web app.
Note: [I have used processbuilder to execute the JAR.]