Article View: borland.public.jbuilder.java.swing
Article #9770Re: finding the application path
From: Tad Frysinger
Date: Tue, 25 Jan 2000 00:00
Date: Tue, 25 Jan 2000 00:00
32 lines
1909 bytes
1909 bytes
The closest thing is a System property user.dir, but this doesn't necessarily equate to App.path. For your applications, why not set a property (use -D on the command line) in your startup called App.path? Tad Frysinger (TeamB) Alan Shiers wrote: > Hi: > I'm familiar with the File objects .path() and .getAbsolutePath() > methods, but these methods don't allow me to obtain the applications > path on the clients machine. In Visual Basic we have a method called > App.path. When I use this method call as part of a string concatination > App.path returns the path leading up to where the program sits on the > clients computer. > So, if myProgram is in C:\MSS\myProgram, App.path will return > "C:\MSS\". > This is how I would like to use App.path in java: > String st = App.path() + "text.txt"; > > Result: st would equal "C:\MSS\text.txt" > > I need a method like this for Java! App.path is a very convenient > method, one that I use a great deal. I need to know, no matter where > the client installs my java program, it will be able to find it's own > application path within the directory structure it is in! Does anyone > have just such a method I can use, or is there already one in existance > in the API that I'm not aware of? > > Regards, > > Alan Shiers
Technical Details
Message-ID:
<388D9C91.AFBCC27@earthlink.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<388105F5.EB860769@istar.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c2ac60c7065ef2cf X-Google-Attributes: gid111d45,public From: Tad Frysinger <tfrysinger@earthlink.net> Subject: Re: finding the application path Date: 2000/01/25 Message-ID: <388D9C91.AFBCC27@earthlink.net> X-Deja-AN: 577364138 Content-Transfer-Encoding: 7bit References: <388105F5.EB860769@istar.ca> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: tfrysinger@earthlink.net Newsgroups: borland.public.jbuilder.java.swing