Error unable to access jarfile *.jar

背景

本地windows写的sh脚本,使用正常,上传到linux无法正常启动springboot程序。

这个sh脚本目的是:启动springboot程序,读取当前目录中的,jar的外部配置。

问题:通过脚本启动报错:Error unable to access jarfile *.jar

脚本示例

#!/bin/bash
java -jar ./*.jar
echo 返回值: $?

修改为加个&

正确示范

#!/bin/bash
java -jar ./*.jar &
echo 返回值: $?

解决问题!

这种方法启动是可以启动,但是执行的不正确,正确做法还是在linux环境写这个配置文件吧,不用加&

猜你喜欢

转载自blog.csdn.net/Mint6/article/details/92774638