I installed netbeans 8.2 recently and I keep trying to create a maven web project
but I'm getting this error.
Cannot run program "cmd" (in directory "C:\Users\Administrator\Documents\NetBeansProjects"):
Malformed argument has embedded quote: "C:\opt\apache-maven-3.6.2\bin\mvn.cmd"
-DarchetypeGroupId=org.codehaus.mojo.archetypes -DarchetypeArtifactId=webapp-javaee7
-DarchetypeVersion=1.1 -DarchetypeRepository=http://repo.maven.apache.org/maven2
-DgroupId=com.dilini -DartifactId=mavenproject1 -Dversion=1.0-SNAPSHOT -Dpackage=com.dilini.mavenproject1
-Dbasedir=C:\Users\Administrator\Documents\NetBeansProjects -Darchetype.interactive=false
-Dmaven.ext.class.path="C:\Program Files\NetBeans 8.2\java\maven-nblib\netbeans-eventspy.jar"
--batch-mode archetype:generate
I updated java ee plugings in netbeans, I added settings.xml
to C:\Users\Administrator\.m2
location which I copied from the maven package.
But nothing seems to be working.
Please help
Update March 2020 - this should be fixed in NetBeans 11.2 and later, released on 25th October 2019. Details in the bug report.
This is caused by a recent change in the JDK. Please see this question for more information. Although the question relates to JDK11 the same change was made to JDK8 and the same solution (it is a work-around, really) applies.
Edit your
netbeans.conf
(you will find this in your netbeans directory underetc
) to add-J-Djdk.lang.Process.allowAmbiguousCommands=true
to thenetbeans_default_options
key. You can edit with notepad but you might need to do it as an Administrator depending on how you installed NB.For example, mine looks like:
Thanks to @Sephiroth for providing the answer.