I am trying to run my java program through bash in a linux system where the command is:
java -Dresources=path1 -Dinstance=instance1 -cp ./lib/jar1.jar;./lib/folder1/*;./lib/common/*; lib/folder2/* com.test.host
In the host class I am reading some XML files, which has spring beans and I am loading them. This command works perfectly fine in windows. However, when I run this in Bash shell. I get the following exception:
syntax error near unexpected token newline 'xml version= 1.0 encoding= utf-8'
I tried removing unnecessary spaces in the XML and tried but to no avail.
As @MarkRotteveel mentioned, after replacing; (semi-colon) with the: (colon), the command works as intended. However, I am not sure why did java not detect the error with the usage and threw an error/exception
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.