Is there a way to find the name of the program that is running in Java? The class of the main method would be good enough.
Also from the command line you could run the jps tool. Sounds like a
jps -l
will get you what you want.