rod*_*ion 37
试试这个:
System.getProperty("user.dir");
Run Code Online (Sandbox Code Playgroud)
Ale*_*s G 15
根据安全模型,如果System.getProperty(String)不允许,您可以使用
String currentDir = new File(".").getAbsolutePath()
Run Code Online (Sandbox Code Playgroud)