728x90
Windows : C:\Users\User\AppData\Local\Temp
Linux : /temp
# 사용 방법
1. System.getProperty("java.io.tmpdir")
System.getProperty("java.io.tmpdir") tmp dir 경로를 리턴함.
public class til {
public static void main(String[] args) {
String tmpDir = System.getProperty("java.io.tmpdir");
System.out.println("tmp= " + tmpDir);
}
}
# 로그 값
=> tmp= /tmp
'개발 > JAVA' 카테고리의 다른 글
[Java] if문을 조건부 연산자로 변경 (0) | 2023.03.06 |
---|---|
[JAVA] api 요청시 Return JSON 데이터 Pretty로 나오게 하는법. (0) | 2023.03.02 |
[Java] 제공되는 타입이 일치하지 않을 때, 비 static 필드는 static 컨텍스트에서 참조할 수 없습니다. 해결법 (0) | 2023.01.18 |
[Intellij] 실행 가능한 jar파일 만들기 (0) | 2022.12.23 |
[Jackson] ObjectMapper serialize, deserialize (2) | 2022.12.16 |