nohup java -Xms300m -Xmx300m -jar $1 >log/$2 2>&1 &
創建一個.sh結尾的腳本,裏面放入此代碼。 須要在jar包的當前目錄下創建一個log文件夾。java
./start.sh test.jar test.log
在log文件夾下可看到日誌。日誌