As a C ++ application, is there a way to request a java process (java.exe / javaw.exe) to retrieve the name of the main class or jar file that was passed to the JVM? I want to get the same result as when running "jps -l":
C:\>jps -l -V
2644 sun.tools.jps.Jps
4340 net.sourceforge.squirrel_sql.client.Main
I think I can get the command line parameter and try to parse the class name, but I was wondering if there is an easier method to reliably retrieve only the class name or jar file name.
Thanks!
source
share