I have a .jar file that I would like to check if it gets called/executed. The program that is supposed to access it is visual studio post build events, but I have no idea if it gets executed.
My OS is Windows 7.
Process Monitor can also monitor file access
Depending on exactly how Visual Studio is running the JAR, you might be able to simply rename the JAR and see if the build breaks.
It's one thing to detect if the JAR file is opened (try Process Monitor), but to see if the specified Main-Class is actually loaded and its byte code executed, you'd need to hook into the JVM with a debugger or instrumentation. That requires some switches passed to the JVM at startup.
As a post-build task, I'd guess the process runs without intervention, and perhaps very quickly, so you'd need to suspend on startup (also possible with startup switches) in order to hook into it.
A lower-tech approach would be to replace the JAR with something that does something very obvious, like display a message or leave a file. You could even take the existing JAR, and modify it slightly so that it runs the "Hello, Obvious" class first, then calls the original class to do what it is supposed to.