How do i find the filename of the class / jar file thats being executed?
807580Aug 7 2010 — edited Aug 12 2010Hi
Anyone know how to find the name of the class / jar file thats being executed and store it in a string?
For example if a doubleclick a jarfile named myjarfile.jar i would like to print out "myjarfile.jar"
And same for classes if i have a class naamed myclass.class i would like it to print out "myclass.class"
ive tried
System.out.println( this.getClass().getResource(".") );
System.out.println( System.getProperty("user.dir") );
but they only give me the working directory
somewhere in the jvm it should say where the bytedata was loaded from.
Thanks for any kind of help.