无法在VScode中创建Maven项目:“程序'cmd'无法运行”

时间:2020-01-05 04:36:55

标签: java maven visual-studio-code

我一直在努力使Maven for Java在VS代码中运行,但是每次尝试创建新项目时,都会出现此错误:

Program 'cmd' failed to run: No application is associated with the specified file for this operationAt line:1 char:1
+ cmd /c mvn archetype:generate -DarchetypeArtifactId="maven-archetype- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.
At line:1 char:1
+ cmd /c mvn archetype:generate -DarchetypeArtifactId="maven-archetype- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
    + FullyQualifiedErrorId : NativeCommandFailed

我同时安装了Java sdk和ApacheMaven(mvn -v在cmd中工作),但是我在VScode中不断收到此错误!

1 个答案:

答案 0 :(得分:0)

以管理员身份运行VSCode,然后应该可以正常工作。