5

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

HFR1994
  • 153

2 Answers2

4

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.

seanf
  • 266
  • 2
  • 6
0

In case that you are using IntelliJ, you can open mvnw file and in the right bottom corner you will probably have "CRLF". You can click on it and change it to "LF". See https://www.jetbrains.com/help/idea/configuring-line-endings-and-line-separators.html#line_ending