我想检索Java 6中当前目录的绝对路径,但是不能使用Paths。
String currentDirectory = Paths.get(".").toAbsolutePath().normalize().toString();
Run Code Online (Sandbox Code Playgroud)
有什么选择?
使用 new File(".").getAbsolutePath()
https://docs.oracle.com/javase/7/docs/api/java/io/File.html#getAbsolutePath()
返回绝对抽象路径名,该绝对路径名表示与此抽象路径名相同的文件或目录
由于:1.2
| 归档时间: |
|
| 查看次数: |
1620 次 |
| 最近记录: |