본문 바로가기

Programming281

[JAVA] gradle 이용 runnable jar 생성 시에 dependency library 포함 진행 build.gradle에 dependencies 에 명시한 lib들을 포함 하기 위하여 아래 스크립트를 삽입 하였습니다! dependencies { // Use JUnit Jupiter for testing. testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' // This dependency is exported to consumers, that is to say found on their compile classpath. api 'org.apache.commons:commons-math3:3.6.1' // This dependency is used internally, and not exposed to consumers on their own co.. 2023. 7. 5.
[JAVA] CloseableHttpClient를 이용한 Http Post 호출 예제 CloseableHttpClient 이용 Http Post 호출 예제입니다. /** * * @param jsonString * @param urlAddress * @return */ private static boolean httpClient(String jsonString,String urlAddress) { String methodName = Thread.currentThread().getStackTrace()[1].getMethodName(); try { HttpPost httpPost = new HttpPost(urlAddress); httpPost.setHeader("Content-Type" , "application/x-www-form-urlencoded;charset=UTF-8"); List.. 2023. 7. 5.
LocalDateTime,TimeStamp 이용 timestamp 값 얻기 (new Date()).getTime() 이 Deprecate 상태 여서 다른 방법을 찾아 보았습니다. module-info.java /** * */ module TestConsole { requires java.sql; } TestCls.java package com.test; import java.time.LocalDateTime; import java.sql.Timestamp; public class TestCls { public static void main(String[] args) { LocalDateTime localDateTime = LocalDateTime.now(); Timestamp timeStamp = Timestamp.valueOf(localDateTime); long lNow =.. 2023. 7. 3.
Ubuntu 20.04.5 TimeZone 변경 방안 출처 : Linux : Ubuntu 20.04 : Timezone 설정, 변경 방법, 예제, 명령어 (tistory.com) Linux : Ubuntu 20.04 : Timezone 설정, 변경 방법, 예제, 명령어 많은 시스템 관련 작업 및 프로세스에는 정확한 시간대를 사용하는 것이 필수적입니다. 예를 들어, 크론 대몬은 크론 작업을 실행하기 위해 시스템의 시간대를 사용하고 로그 파일의 타임스탬 jjeongil.tistory.com Ubuntu GUI 에서는 설정을 변경 할 수 없어 출처의 내용 과 같이 UTC 기준에서 Asia/Seoul로 변경 시도를 하였습니다. $ timedatectl Local time: Mon 2023-07-03 08:05:33 UTC Universal time: Mon 202.. 2023. 7. 3.