Locating user's current directory
I have Java console program packaged using InstallAnywhere 2009 and the program is wrapped the using Launcher. Inside the program it access user's current directory using :
String path = ".";
String currentdir = File(path).getCanonicalPath();
I realized that the return value (currentdir) always repsected to the location of the wrapper program (i.e. c:\program files\myapp\bin if the wrapper is located in C:\program files\myapp\bin\myprog.exe). If path is absolute path then it is okay. How can I fix this to return the actual path from where the launcher is called?
I found my answer. If lax.user.dir is left blank, according to the manual, it will cause the native launcher to not
alter the platform default behavior for setting the user dir.
And this is exactly what I need.