🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
3 messages
3 total messages Started by Eric Orilla Wed, 30 Mar 2005 04:09
Absolute Path where the main() resides
#66
Author: Eric Orilla
Date: Wed, 30 Mar 2005 04:09
6 lines
887 bytes
Hi there, 

I want to get the full path of the jar file containing my main() function, any info is appreciated!

Thank you
Re: Absolute Path where the main() resides
#68
Author: Shankar Unni
Date: Wed, 30 Mar 2005 18:17
14 lines
1412 bytes
Eric Orilla wrote:

> I want to get the full path of the jar file containing my main() function

One of those trivia that I couldn't even Google for easily, so I bit 
back my automatic suggestion.

Answer:

  Class.getProtectionDomain().getCodeSource().getLocation()

Get the class object for your class, and call the above. You'll get a 
URL to the location. (Remember, classes and jars can also be loaded over 
the net..)
Re: Absolute Path where the main() resides
#69
Author: John McGrath [TeamB]
Date: Wed, 30 Mar 2005 21:32
15 lines
1257 bytes
On 3/29/2005 at 11:09:44 PM, Eric Orilla wrote:

> I want to get the full path of the jar file containing my main()
> function, any info is appreciated!

http://www.visi.com/~gyles19/fom-serve/cache/391.html

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads