This is Qiita's first post.
java1.8.0_221
Suppose you are running C: \ Users \ Miyayu \ IDEA \ example \ example.jar
.
I want to retrieve C: \ Users \ Miyayu \ IDEA \ example
(String type).
FileSystems.getDefault().getPath("").toAbsolutePath().toString()
only this! Isn't it easy?
I want to know the absolute path of . \ expdir \ hoge.json
FileSystems.getDefault().getPath("expdir","hoge.json").toAbsolutePath().toString()
Recommended Posts