Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 44097 invoked from network); 5 Dec 2002 22:48:56 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 5 Dec 2002 22:48:56 -0000 Received: (qmail 24093 invoked by uid 97); 5 Dec 2002 22:49:58 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 24058 invoked by uid 97); 5 Dec 2002 22:49:58 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 24046 invoked by uid 98); 5 Dec 2002 22:49:57 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Thu, 05 Dec 2002 17:48:46 -0500 From: Laurie Harper User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US; rv:1.2b) Gecko/20021016 X-Accept-Language: en-us, en MIME-Version: 1.0 Subject: Re: [OT] getting name of launch jar References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <2952.3defd7d0.15815@pulse> X-Newsgroups: apache.jakarta.ant-user X-Newsgroups-Sender: zodiac@holoweb.net X-Newsgroups-Server: 217.158.110.66:119 X-Newsgroups-Client: 216.94.134.192:23433 To: ant-user@jakarta.apache.org X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Wow, that was fast! Both methods seem to work, awsome! I might have eventually figured out the first option but I doubt I'd have found the second one :-) Thanks, L. Dominique Devienne wrote: > I believe Java puts the path of that JAR in the java.class.path Java > System > Property. Or use Steve's L. trick of doing > someClass.getProtectionDomain().getCodeSource().getLocation(). > > --DD > > -----Original Message----- > From: Laurie Harper [mailto:zodiac@holoweb.net] > Sent: Thursday, December 05, 2002 4:11 PM > To: ant-user@jakarta.apache.org > Subject: [OT] getting name of launch jar > > (I know this is off-topic for this list, but I need to find an answer > fast or change approach so I was hoping someone might be able to give me > a pointer!) > > I've got an application which is packaged as a single jar, launched by > 'java -jar myapp.jar'. The problem is I need to be able to get the path > and file-name of the jar file. > > Does anyone know if there is a way to do this? > > Thanks, > > L. > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: