How to find an application installation path directory with java
I have installed my jar application using packjacket, an installer generator.http://packjacket.sourceforge.net/
default installation path will be in "../program files/myapp.jar"
but how can java language detect different installation path if user decide to change to different path directory during installation. (currently i just hard code the default location as C:/../program files/)
i have read this question, How to find an application installation path in the ms windows registry via EXE name. But regrettably still not understand.
ps: im not sure if my jar application have registry path or not because i rely on packjacket installer to install my apps.
this reference is unclear: find the path of my application installed in registry
Your question is a little unclear.
Your application should never make assumptions about where it might be stored and should rely on relative paths or know variable paths, such as the user's home directory (System.getProperty("user.home")).
You can find you current "working" directory using System.getProperty("user.dir")