Linux SpringBoot startup cannot load dubbo interface class

classpath=`find ./lib -name "*.jar"|xargs|sed "s/ /:/g"`
classpath=".:$classpath"

java -Xms256m -Xmx1024m -classpath ${classpath} com.lwb.test.Test >test.log 2>&1 &

When starting up, it directly prompts that one of my custom classes cannot be found.
The problem is that I can find my interface.jar manually by running the first line.

find ./lib -name "*.jar"|xargs|sed "s/ /:/g"

Finally, I found out that my script actually used Windows characters, and something went wrong when running Linux.
Once, the following prompt appeared:

$'\r': command not found

Later I discovered that there was a problem with the script:
I needed to execute the following command, start.sh is the name of my startup script:

dos2unix start.sh

Guess you like

Origin blog.csdn.net/lwb314/article/details/121824806