์๋ฐ ํ๋ก๊ทธ๋จ์ ์ง๋ค๋ณด๋ฉด ํ์ฌ ํ๋ก์ ํธ์ root ๊ฒฝ๋ก๋ฅผ ํ์๋ก ํ ๋๊ฐ ์๋ค.
๊ทธ๋ด ๊ฒฝ์ฐ ์๋์ฒ๋ผ
public static void main(String[] args) {
System.out.println("Current Working Directory = " + System.getProperty("user.dir"));
}
System.getProperty ๋ฉ์๋์ user.dir ์ ์ธ์๋ก ๋ฃ์ด์ฃผ๋ฉด ํ์ฌ ํ๋ก์ ํธ์ root ๊ฒฝ๋ก(absolute path)๋ฅผ String ์ผ๋ก ๋ฐํํฉ๋๋ค.
Use 'System.getProperty("user.dir")' method for getting current working directory as absolute path. The method returns a string value of the root path of the java project as an absolute path.
'๐ป Programming > Java' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Java] Heap Memory Check (์๋ฐ ํ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋ ์ธก์ ) (0) | 2018.07.28 |
---|---|
[Java/์๋ฐ] ํ ์คํธ ํ์ผ ๋ด์ฉ ์ฝ์ด์ ์ถ๋ ฅํ๊ธฐ (0) | 2016.12.04 |
์๋ฐ ๊ฐ์ฒด๋ฅผ byte[] ๋ก ๋ณํํ๊ธฐ (0) | 2015.08.08 |
JVM ํด๋์ค๋ก๋๋? ( What is ClassLoader ? ) (0) | 2015.06.18 |
[ Java / ์๋ฐ ] ์์คํ ๋ ๋ฆฝ์ ์ธ ๋ผ์ธ ๊ตฌ๋ถ์ (0) | 2015.04.27 |