Idea's cmd and git bash don't see mvn command - maven

Idea's cmd and git bash don't see mvn command.
If I run this out of Idea it works:
But in Idea's CMD or Bash I see "mvn: command not found"
Why this happens? I set path to C:\Maven\apache-maven-3.5.0\bin.
On Linux it works well.

these are issue with maven path configuration into your system. try to reconfigure the maven, you can also refer this link to configure.
https://www.mkyong.com/maven/how-to-install-maven-in-windows/

Set path as below
export PATH=$PATH:/c/Program\ Files/Java/jdk1.8.0_221/bin:/c/Program\ Files/apache-maven-3.6.1/bin

Related

mvn commands not recognize JAVA

Can anyone help me with this issue?
It seems that when I run mvn -v command from command line directly from windows the command works as expected.
When I run mvn -v command from Jenkins build I got the following error.
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
JAVA_HOME env is set to : C:\Program Files\Java\jdk1.8.0_144\bin I also tried without \bin but it's not working.
%JAVA_HOME% is added also in Path
Thanks.
Looks like your Jenkins instance is unable to find local system's environment variable "JAVA_HOME".
Try providing the environment variable in the command itself with "mvn -DJAVA_HOME=C:\Java\jdk1.8.0\bin -v"
For long term fix, define system or user variables for JAVA_HOME or inject environment variable manually inside Jenkins.

How to use IntelliJ bundled maven in terminal?

Using MacOS Catalina. Installed IntelliJ. Maven works fine but in terminal mvn comand is not found. How to use IntelliJs maven in terminal?
Locating mvn installed using IntelliJ
If you are specifically looking for mvn location, installed using IntelliJ on MacOS: /Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/mvn
Executing mvn from terminal
Now, if you want to execute mvn from terminal, you need to add to your path.
Assuming that you'are using zshrc, which is my case, you'll need to add the following command to ~/.zshrc
export PATH="$PATH:/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin"
Now, reopen your terminal, and you can call mvn.
Obs.: Thanks to nbro's answer
Solving "Permission Denied"
If you try to execute mvn and get "Permission Denied", you need to give execution permission:
chmod +x "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/mvn"
In my case, I added the following 2 commands to ~/.zshrc (which is what I am using)
export PATH="/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin:$PATH"
# Otherwise we get a "permission denied"
chmod +x "/Applications/IntelliJ IDEA.app/Contents/plugins/maven/lib/maven3/bin/mvn"
Now, I can call mvn from the terminal.
On linux (Ubuntu) when installed by toolbox, it might be something like this:
/home/<username>/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7142.45/plugins/maven/lib/..
In Windows You may find Idea location by env variable
PS > Get-ChildItem env:"Intellij IDEA"
Name Value
---- -----
IntelliJ IDEA C:\Users\unknownuser\AppData\Local\JetBrains\IntelliJ IDEA 2020.3.4\bin;
then use M2_HOME env variable to store related maven path
C:\Users\unknownuser\AppData\Local\JetBrains\IntelliJ IDEA 2020.3.4\plugins\maven\lib\maven3
and use it in the path
%M2_HOME%\bin
Mine under windows is under a weird location:
C:\Users\changeMe\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\222.3345.118\plugins\maven\lib\maven3
Note that on Windows, from a Terminal console using CMD, you can execute mvn command using CTRL+Enter in IntelliJ :
As of the feature description under https://blog.jetbrains.com/idea/2020/07/run-ide-features-from-the-terminal/, this feature is also supported for MacOs with Cmd+Enter.
Run highlighted command using IDE (default shortcut: Ctrl + Enter or Cmd + Enter)
Debug highlighted command using IDE (default shortcut: Ctrl + Shift + Enter or Cmd + Shift + Enter)

PATH not working on Mac OS X 10.10.3

I want to configure maven and wildfly on my local mac computer. in terminal I use zsh shell. so, I input maven and wildfly home in .zshrc file as
MAVEN_HOME="/Users/myuser/Development/maven"
JBOSS_HOME="/Users/myuser/Development/wildfly"
and then
export PATH="$PATH:$JBOSS_HOME/bin:$MAVEN_HOME/bin"
but when I type maven command in terminal, it shows me this response
zsh: command not found: maven
then I put all 3 commands in .bashrc and .bash_profile files. but nothing. even after reboot. what is wrong?
Maven command is mvn, not maven :)

Stardog Command not found

I am trying to get to install stardog on mac 10.8.5 using the instructions provided at http://docs.stardog.com/quick-start/.
The export path particular directory has been created and for which echo’ed to make sure that environmental variable is set up. The license key that is provided is also in the correct directory. When I try to run “$ ./stardog-admin server start” the command is not recognized. So I tried to create an export PATH to stardog’s bin, which did not work either.
I have also tried manually adding the path in the following:
- ~/.bash_profile
- ~/.profile
Still no luck, any ideas?
Using zsh I had a similar problem. For some reason, the docs suggest that from the stardog-directory-name directory you can run the command, but it didn't work until you cd into the bin directory. Once there ./stardog-admin server start should run correctly.
It sounds like you simply have something incorrect in your .bash_profile or .profile. If you run either of the stardog scripts from it's bin directory, it will work. If you're getting a command not recognized error, that sounds like bash cannot find the stardog-admin script.

Unable to run git from command line

I have installed GIT for Windows right now. And when I am running this into my symfony project to reinstall the vendors by
php bin/vendors install --reinstall
Then i am getting an error
git' is not recognized as internal or external command
I have set the environmental variables also as
c:/programme files/git/cmd
Now what should I do?
I have tried also for environmental variables
c:/program files/git/bin
but I am getting the same error
Two possible solutions:
My PATH has backslashes instead of forward ones.
your first line contains a typo, should be c:\program files\git\cmd
One more: If your path includes spaces, enclose it in quotes:
set PATH=%PATH%;"C:\Program Files\Git\cmd"
During Git installation, in the path environment settings chose the following one.
Even I had the same problem, of git not executed on my normal Command Line, but i just reinstalled it with the setting "Run Git from the Windows Command Prompt"
Just open cmd and run this command:
set PATH=%PATH%;"C:\Program Files\Git\cmd"

Resources