[英]how to get exitcode when launching java application from command line
i made a program which returns an exitCode (from an ExitCodeGenerator).我制作了一个返回 exitCode(来自 ExitCodeGenerator)的程序。 it works very well when i launch my application with command line like :
当我使用以下命令行启动我的应用程序时,它运行良好:
mvn spring-boot:run (i see my exitCode) mvn spring-boot:run(我看到我的退出代码)
but how to get returned exitCode when i launch my application with this kind of command ?但是当我使用这种命令启动我的应用程序时如何获得返回的退出代码?
java -jar target/<my-application-1.0-SNAPSHOT.jar> java -jar target/<my-application-1.0-SNAPSHOT.jar>
thanks by advance提前致谢
If you are using bash:如果您使用 bash:
echo $?
If you are on windows:如果您在 Windows 上:
echo %ERRORLEVEL%
Give you the exit value of the last run program.给你上次运行程序的退出值。 For example 0 often for a successful execution, everything else for (different) errors
例如 0 通常表示成功执行,其他所有表示(不同的)错误
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.