When idea executes the command, an error is reported: CreateProcess error = 2. The system cannot find the specified file

Problem description

Error running ' mvn install:install-file -DgroupId=xxx.xxx.xxx -DartifactId=myArtifactId -Dversion=0.7.0 -Dpackaging=jar -Dfile=E:\myProject.jar ': Cannot run program "mvn" (in directory "E:\javawarkspace\webhisprotal\ips-portal-admin\hsa-ips-admin-biz\src\main\java\cn\hsa\ips\admin"): CreateProcess error=2, The system cannot find the specified file . However, it can be executed normally in the command line window.

Problem solving

When using the idea command, the prefix cannot have extra spaces. Note the beginning of the command: 'MVN install: install file... , there is a space here. Cause program exception.


Read More: