0

I've been trying for so long to get Maven for Java to work in VS code but every time I try making a new project I get this error:

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

I have both the Java sdk and ApacheMaven installed (mvn -v works in cmd) but I keep getting this error in VScode!

Saikat
  • 14,222
  • 20
  • 104
  • 125
  • Might be easier to report this as an [issue](https://github.com/Microsoft/vscode/issues) to the vscode team – smac89 Jan 05 '20 at 04:57
  • Can you elaborate more on the question? How are you running that command? – Deep Jan 05 '20 at 18:45
  • @Golu I'm not running any commands myself, I'm trying to create a new Maven project through the VSCode GUI (there's a button that adds a new project) and I keep getting that error. I've tried multiple Maven archetypes and they all give that same error, every single time. – Test Accent Jan 06 '20 at 01:48
  • you could refer to the [create maven project](https://stackoverflow.com/a/46727175/10768653) – Leo Zhu Jan 06 '20 at 06:35
  • could it work follow the link step ? – Leo Zhu Jan 15 '20 at 08:19

1 Answers1

0

Run the VSCode as an administrator.It should work fine then.

Deep
  • 929
  • 2
  • 16
  • 32