Click to See Complete Forum and Search --> : Application path


rparikh
April 5th, 1999, 01:03 PM
Hi :
How do I determine what path my java main application class is loaded from. "user.dir" is the current working directory, but if the actual jar or class file is loaded from some other directory, how can I determine that directory inside the program?
TIA,Rima Parikh.

sjeevan
November 29th, 2000, 08:04 AM
What r u using ?
If JSP, the application object is available implicitly, inside JSP, application.getRealPath(""), will return you what you want.
FYI, application object is part of javax.servlet.ServletContext package

rgds

sionide21
October 10th, 2005, 09:52 PM
Thank you sjeevan I spent quite a while looking for this little code. It was very helpful