问题原文
原帖链接 · HFR1994 · CC BY-SA 4.0
I'm trying to run my ./mvnw from a Spring Boot project in a WSL (Ubuntu) with Windows 10 Enterprise Build 1803. But I keep getting the same error every time:
: not found ./mvnw:
: not found ./mvnw:
./mvnw: 53: ./mvnw: Syntax error: word unexpected (expecting "in")
Script works fine on a normal Linux server. In order to get a successful build I have to go to Powershell and run the same command ("./mvnw install dockerfile:build") and then return to my WSL and continue.
Command is to build a Docker image which later on is used on a Docker Compose.
Any ideas?
Thanks
已采纳解答
原帖链接 · seanf · CC BY-SA 4.0
Something has probably messed with the line endings in the mvnw script.
If you have dos2unix installed (sudo apt install dos2unix), you should be able to repair the script with dos2unix mvnw. Or just download it again.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
