查看 Java 版本

1
2
3
4
➜  ~ java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (Zulu 8.50.0.1017-CA-macos-aarch64) (build 1.8.0_275-b01)
OpenJDK 64-Bit Server VM (Zulu 8.50.0.1017-CA-macos-aarch64) (build 25.275-b01, mixed mode)

运行 Jar 包

1
java -jar app-1.0-SNAPSHOT.jar

后台运行 Jar 包并限制内存

1
nohup java -Xms128m -Xmx128m -XX:PermSize=128M -XX:MaxPermSize=128M  -jar app-1.0-SNAPSHOT.jar  > /dev/null 2>&1 &