The foolproof way of finding application's directory(folder) ?
843810Jun 29 2010 — edited Jun 30 2010Hi All,
What is the foolproof way of finding one's application's directory through code?
The property "user.dir" is no good as it returns different values for the same application without any change in the application's location. I found that on the first run of the application, it returns the correct directory path, but on the second or subsequent runs, it returns the path of a subdirectory of the application.
Same goes for the method - new File().getAbsolutePath()
I googled for it and found only the above two methods are mentioned in the forums where this question has been raised. Surely there must exist a more reliable way of finding one's application's path.
Thanks for any advice that you can offer.
Regards,
Dinesh Bajaj