Java應用程序有可能知道它自己的當前目錄。我指的是pwd
的結果。Java程序可以知道它的當前目錄嗎?
例如,執行
~/Documents/workspace/Project/bin $ java com/foo/bar/baz/Runner files/text1.txt
program should know ~/Documents/workspace/Project/bin
~/Documents/workspace/Project $ java com/foo/bar/baz/Runner files/text1.txt
program should know ~/Documents/workspace/Project
很酷。謝謝Nim – JAM 2012-02-06 15:54:59
@JAM - 不用擔心... – Nim 2012-02-06 16:02:26
這段代碼究竟幹嘛呢? – 2012-10-04 01:35:52