IntelliJ terminal setup - windows-7

I used to run gradle test via IntelliJ terminal with following command,
>gradle test Accidentally I deleted my windows path environmental variable in my windows 7 machine.
After this when I run above command I get below error
'gradle' is not recognized as an internal or external command,
operable program or batch file.
What should I add in path environmental variable to get this run again
IntelliJ version 13.0.3
I added all java and gradle path under env. variable (I can run test via cygwin with above command)
Thanks

This issue was resolved after restarting the windows. Because after adding path to the env variable and restart IntelliJ was not enough.
I should have done this before posting the question.
Please bear with me if any convenience caused.
Cheers

Related

Gradle miss environment variable when running tasks from IntelliJ IDA in WSL

I'm working on a Gradle project with multiple sub modules. Some of these are using maven. Thus one Gradle task is running maven from the MAVEN_HOME directory. This task is called by IntelliJ IDEA during Gradle refresh. When running IntelliJ Community Edition 2021.1 on an Ubuntu 20_05 VM, everything works fine. When running the same version of IntelliJ Windows with WSL 2, the task fails with error
MAVEN_HOME environment variable not set, unable to locate mvn executable for build
When I open a shell in WSL, I see that the MAVEN_HOME is actually set. I've defined it in my ~/.profile file. I can build my project from the terminal command line. IntelliJ IDEA uses the Gradle wrapper for building the project. It uses the shebang #!/bin/env sh. So it is not opening a login shell und thus the ~/.profile files are not read.
Any ideas how to solve this problem?

'mvn' command is not recognized as an internal or external command, was working

Yesterday, I went through a tutorial that had me set up maven, and I got the project working, and shutdown the windows pc.
Now today, the mvn command isn't working.
C:\>mvn -version
'mvn' is not recognized as an internal or external command,
operable program or batch file.
My system variable:
MAVEN_HOME=C:\opt\apache-maven-3.6.3
My path variable includes this at the end:
;%MAVEN_HOME%\bin
It looks like my system variable is set up correctly:
Make sure that when you're seetting up your M2_HOME that it's pointing to you Maven basedir, NOT the bin dir.
Afterwards, make sure to set the path and PATH something like so: (PATH=%M2_HOME%\bin;%PATH%).
Then restart your machine and run this command.
dir %M2_HOME%\bin\mvn*
If there is a .bat file, it should work since you seem to run Windows. If there isn't one, then your paths are not right and you need to make sure your %PATH% variable points to the correct path to Maven.
Not sure why, but its working as it should today, no changes were made other than a restart of the windows PC. Will continue to monitor, but I can't replicate the problem to investigate it anymore.

cmd cannot find mvn command

I just installed Maven and added the \bin directory of maven to my path variables. When I try to use the mvn command in the Command Prompt I just get a message:
mvn: command not found
Everything else I found on here did not help yet.
Edit:
I used https://maven.apache.org/install.html to install maven.
SET PATH=%PATH%;C:\Program Files\Maven\apache-maven-3.5.0\bin\mvn.cmd
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
You have included the file in the path:
C:\Program Files\Maven\apache-maven-3.5.0\bin\mvn.cmd
That is not good. The PATH environment variable should only include a path to where files, like exe and cmd's can be found.
Adapt your PATH to read like this:
C:\Program Files\Maven\apache-maven-3.5.0\bin
(so remove the \mvn.cmd). Make sure to start a new command prompt to verify if your path settings are correct.
See How can I set user environmental variables (such as PATH) from a non-administrator account on Windows 7 to find the correct Windows dialog to adapt the settings among many more.
Following this tutorial by mkyong, I was able to get this to work on Windows 10 (v10.0.15063):
Install JDK and setup JAVA_HOME system variable
Download Maven zip, extract it and setup M2_HOME and MAVEN_HOME system variables to point to root maven folder (without \bin)
Update PATH system variable to include %M2_HOME%\bin (this is what will let you run "mvn" in Command Prompt).
Open Command Prompt (cmd.exe) and execute mvn -version
You can download Maven (apache-maven-3.5.0-bin.zip) here, if you don't have it already.
The Java SDK (jdk-8u144-windows-x64.exe) can be downloaded from Oracle here.
This is my working maven configuration on Windows 10. Was more cumbersome to configure on W10 than on WXP or W7.
I've faced the same problem. I installed Maven and added the \bin directory of maven to my path variables in System Variables, so I can only use MAVEN commands using admin rights (run cmd in windows as administrator)
I solved this by creating all under User variables (including the PATH variable).

Cannot use jar command on windows

The jar command is not working on my box. I have downloaded the jdk, and set the envar "Path" to include the path to the jdk \bin directory. However, I still get that annoying message, "'jar' is not recognized as an internal or external command, operable program or batch file." Does anyone have any suggestions to solve this problem?
I think from the error message that you're using Windows?
If so, did you try it in a command prompt that you opened after changing your path using the GUI? And did you double check for typos in the path you added?
You can always try running "echo %PATH%" to check your path, and ensure your change is both showing up and error free
Can you paste the result of env command ? Or please launch new command prompt, then please try again if you think you configuration is Ok.

Hudson -- Windows execute windows batch command

I currently running the following commands on a hudson slave deployed on a windows machine.
dir
cmd
mvn clean install
I get the following return on the build.
mvn' is not recognized as an internal or external command,
operable program or batch file.
I have set the correct path on the node which points to the hudson installation on the windows machine.
I have also set the correct Path for JAVA and M2_HOME on the windows slave machine.
I was hoping for the correct way to call maven and maybe another *.bat file if need be in the future.
Please and thank you
I still haven't figured this out. A good work around is to use the full path to mvn to run it. Which worked for me.

Resources