자바 조작 리 눅 스
Java
조작Linux
실행 스 크 립 트 사용java.lang.Runtime
import lombok.extern.slf4j.Slf4j;
/**
* @Title callCloseCommand
* @Description
* @Param
* @param
* @return void
**/
private void callCloseCommand() {
String command = "./server.sh stop";
log.error(" API , IP ", command);
try {
Runtime.getRuntime().exec(command);
} catch (Exception e) {
log.error("Linux ,{}", command);
e.printStackTrace();
}
}
command
내용 을 조정 하여linux
문 구 를 변경 할 수도 있다.예 를 들 어./server.sh restart
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
자바 조작 리 눅 스Java조작Linux실행 스 크 립 트 사용java.lang.Runtime 주:실제 상황 에 따라command내용 을 조정 하여linux문 구 를 변경 할 수도 있다.예 를 들 어./server.sh restart...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.