Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6417

Unable to run 'sudo mvn' in WSL

$
0
0

When trying to run sudo with mvn e.g. 'sudo mvn spring-boot:run', in WSL (Ubuntu 24), I get the following error: 'sudo: mvn: command not found'.Obviously, maven is installed and runs perfectly without sudo. Also, running sudo with other commands works fine as well e.g. sudo apt-get update etc.

Just to preclude any questions why I am trying to run 'sudo mvn spring-boot:run' is that when I ran it without sudo, my SpringBoot app crashes with 'java.net.BindException: Permission denied', probably on port 80, although the error stacktrace doesn't say so (in application.preperties, server.port=80, and the port is not in use i.e. sudo lsof -i:80 shows nothing).

The error happens on both my WSL and my AWS EC2 instance (which also uses Ubuntu 24), but the way I overcome it on EC2 is by using sudo, but I can't do the same on WSL.

Would be grateful for any suggestions.


Viewing all articles
Browse latest Browse all 6417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>