Re: How can I get the path to the jar file my program was loaded from?
Posted By:
Anonymous
Posted On:
Wednesday, July 14, 2004 01:20 AM
I dont think that you can modify your own jar - that file is in use by the os.
Re: How can I get the path to the jar file my program was loaded from?
Posted By:
Jason_Adams
Posted On:
Saturday, July 10, 2004 10:38 AM
I am answering my own question so no one will waste their time on this. The ProtectionDomain does indeed return a non null CodeSource which will give you a URL with a normal jar file. How ever for those of you who use Borland's JBuilder like I do and create a somewhat native executable you will find that even though Borlands executable is a jar file with a native launcher in it, it does not provide the CodeSource to the ProtectionDomain thus resulting in a null reference. I guess it is back to the drawing board for hiding my license keys in the jar. Or in this case the executable.