0
我有這樣的代碼:如何調用相對於當前目錄的代碼。
String[] cmd = { "osascript","mylocation" };
Process process = Runtime.getRuntime().exec(cmd);
process.waitFor();
位置myLocation
文件是我script
文件夾內。此課程在src
文件夾中。我試過../script/file
,這是行不通的。
如何在script
文件夾中調用該文件?
你在找這個? http://stackoverflow.com/questions/4871051/getting-the-current-working-directory-in-java – Kon