'export' is not recognized as an internal or external command

Maven

Maven Problem Overview


I need to set Maven options in machine. I ran following command and I got 'export' is not recognized as an internal or external command

export MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

Maven Solutions


Solution 1 - Maven

'export' command is valid only for unix shells. In Windows - use 'set' instead of 'export'

Solution 2 - Maven

I tried set, didn't work for me, in the end:

 $env:

worked. But you have to put your string in quotes like:

$env:SPOTIFY_CLIENT_ID="XXXX"

Solution 3 - Maven

SET does work as mentioned above.

In case anyone wants to know how to use the data stored in variable use %variable%. if you want to print value in command prompt use echo %variable%

ex: SET myVar = testsite.co.uk

To print in command prompt: >echo %myVar%

To use in code, just use %myVar%

Solution 4 - Maven

Was facing the same issue.Turned out I was doing a rookie mistake. Try this instead:

set MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n

Solution 5 - Maven

I am using this way:

$MAVEN_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"

Solution 6 - Maven

Use "git bash here" on Windows it will work. You can install git from https://git-scm.com/downloads

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDamith GanegodaView Question on Stackoverflow
Solution 1 - MavenaniltilantheView Answer on Stackoverflow
Solution 2 - MavenartworkjpmView Answer on Stackoverflow
Solution 3 - MavenjackView Answer on Stackoverflow
Solution 4 - MavenAbhinandan MadaanView Answer on Stackoverflow
Solution 5 - MavenDzintarsView Answer on Stackoverflow
Solution 6 - MavenFawad ImranView Answer on Stackoverflow