Getting the absolute path of the current executing file
800295Jun 18 2007 — edited Jul 2 2008I have a file which will be placed in window and linux environment. It is not good to change the source code in that way:
String path = "D:\\java\file1.txt"; (Window)
String path = "/java/file1.txt"; (Linux)
So I would like to ask how to get the absolute path based on that executing file?
I referred to the reference in jsp, but I don't know what class and the coding syntax in console environment.
Thx for any help.