Jmeter error with version even if PATH are set - jmeter

Getting this error message below.
' java -version 2>&1 | findstr /i "version" is not recognized as an internal or external command,
operable program or batch file.
Not able to find Java executable or version. Please check your Java Installation.
errorlevel=2
I have these in PATH but still error is still appear. Any idea?
PATH is already set to
C:\Program Files (x86)\Java\jdk1.8.0_45\bin\;C:\Program Files (x86)\Java\jre1.8.0_45\bin\;C:\Program Files (x86)\Java\jre7\bin;C:\Program Files (x86)\Java\jre7\bin\java.exe

Your path is wrongly configured.
Define it correctly using:
setenv PATH=%PATH%;Full path to java bin folder
Ensure you put quote around path.
You say it's already define, are you sure there is a java in the defined place ?
Note you have 2 different versions of Java in path.

Issue is not with environment path as java path has been set correctly.
Issue was with broken variable and resolved by resetting broken ComSpec variable.
Run cmd as Admin and reset with command below.
setx ComSpec %SystemRoot%\system32\cmd.exe /m

Related

How to keep the PostgreSQL path in environment variable forever?

I install PostgerSQL on Windows. I also added the bin and lib to PATH, using the following command:
cd C:\Program Files\PostgreSQL\14\bin
set path=%PATH%;%CD%
setx path "%PATH%"
Then, I check the psql version by psql --version command, and it display:
WARNING: The data being saved is truncated to 1024 characters.
SUCCESS: Specified value was saved.
Then, I check the the path using echo "%PATH%" and I see the path C:\Program Files\PostgreSQL\14\bin with all other paths.
However, each time I close the cmd and open it again the PostgreSQL path is removed while all other paths are still there, and the command psql --version is not recognized.
'psql' is not recognized as an internal or external command,
operable program or batch file.
I need the path to be there always I cannot add the path each time I open the cmd.
How could I add the PostgreSQL path to the environment variables forever? because I need to use psql with Git Bash also.
Why the the PostgreSQL path is removed while all other path are there?
I already looked in many questions here and apply the solutions, but still I have this problem.
NOTE: I already added the node.js path using the same commands and it works for node.js, but not work for PostgreSQL
You should go to Advanced system settings > [Environment Variables...] > System variables > Path > [Edit...] and append your path to that list.
The variable you set via setx is only stored for current shell session. But with that via system you will set it forever.
instruction with screenshots can be found here

I was trying to run yarn,but am getting this issue.Yarn is installed but cant even access the version

yarn --version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
Please update C:\Users\shriy\Downloads\hadoop-3.1.0\etc\hadoop\hadoop-env.cmd
'-Dhadoop.log.dir' is not recognized as an internal or external command,
operable program or batch file.
Your java environment path must not contain space. The solution is as follows:
In the cmd line, charge the directory that contain the jdk (in my case C:\Program Files\Java\jdk1.8.0_73).
execute the following line "for %I in (.) do echo %~sI" to display the short name of your installed jdk (in my case C:\PROGRA~1\Java\JDK18~1.0_7)
in the file "hadoop-env.cmd", change the line "JAVA_HOME=%JAVA_HOME%" with "JAVA_HOME=C:\PROGRA~1\Java\JDK18~1.0_7".
run again the file "hadoop-env.cmd" and it will work correctly.

mingw path in environment variable on windows10

I am trying to add a mingw compiler in windows on qtcreator and i have done what the internet has said, add the path to system environment variable. C:\Qt\5.15.0\mingw81_64\bin is the path i used(no spaces) but when i tried to do a gcc -version in cmd, i get
'gcc' is not recognized as an internal or external command,
operable program or batch file.
setpath gives me
C:\>set path
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;...C:\Program Files\CMake\bin;C:\Qt\5.15.0\mingw81_64\bin;...
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
What do i do to fix this?
Can you check it really exists there by running:
DIR C:\Qt\5.15.0\mingw81_64\bin\gcc.exe
If it's not there then try
DIR C:\Qt\5.15.0\mingw81_64\bin\*gcc.exe
to see if you have something like x86_64-w64-mingw32-gcc.exe, which is what you should use then instead.

Why does spark-shell fail with "'""C:\Program' is not recognized as an internal or external command" on Windows?

While running the following command prompt I am getting the error as in the screenshot.
Command:
c:\spark>spark-shell
Error:
'""C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Why?
Suprit,
The issue is most likely with the space in your JAVA_HOME.
If the path contains spaces, use the shortened path name. For example, C:\Progra~1\Java\jdk1.8.0_131
If you are using Windows10. please try the below
Set JAVA_HOME as "C:\Progra~1\Java\jdk1.8.0_131"
Also make sure you have included %JAVA_HOME%\bin in your PATH environment variable.
I suspect that you installed Java to a directory with a space so JAVA_HOME breaks spark-shell script on Windows.
Make sure you install Java to a directory with no space in the path.
The other option would be to set JAVA_HOME to the same value but wrapped with double quotes, e.g.
set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_131"
That will likely lead to the other issue on Windows that was answered in Why does spark-shell fail with "was unexpected at this time"? that's simply to re-install Java to a directory with no space in the path.
The thing I could not check out yet would be to wrapped JAVA_HOME using single quotes (not double quotes). That in theory would help pass the line with comparison to "x".
First you gotta find out where is your JAVA_HOME. In my case it is, "C:\Program Files\Java\jdk1.8.0_25\bin\java"
Then open your file called spark-class2.cmd, locate and change to your java home path (change only the bold text below).
Additional text are included for completeness only.
"C:\Program Files\Java\jdk1.8.0_25\bin\java" -Xmx128m -cp "%LAUNCH_CLASSPATH%" org.apache.spark.launcher.Main %* > %LAUNCHER_OUTPUT%
for /f "tokens=*" %%i in (%LAUNCHER_OUTPUT%) do (
echo %%i
set SPARK_CMD=%%i
)
del %LAUNCHER_OUTPUT%
%SPARK_CMD%
I had same issue. I uninstalled java and installed in C:\Java folder , changed the required env settings and it just worked for me!!!
I had the same problem.
It happens with version spark-2.1.1-bin-hadoop2.7 but not with the previous version spark-2.1.0-bin-hadoop2.7.
Edit line 54 of spark-2.1.1-bin-hadoop2.7/bin/spark-class2.cmd by removing the quotes as:
set RUNNER=%JAVA_HOME%\bin\java
Then it should work.
Somewhere you have set a path or variable without wrapping it in double quotes. Hence the path is being split on the first space.
C:\Program Files\Whatever
has become...
C:\Program
To fix it you need to make sure you wrap path variables in double quotes.
i.e
C:\Program Files\Whatever\Foo\My Bar\bin
should be
"C:\Program Files\Whatever\Foo\My Bar\bin"
or even better use environment variables for user paths. e.g.
"%PROGRAMFILES(X86)%\Whatever\Foo\My Bar\bin"
"%PROGRAMFILES%\Whatever\Foo\My Bar\bin"
You need to set the Environment variable to use spark-shell from any directory.
Or you need to go inside bin folder to execute spark-shell command
in my case its inside /spark/spark-2.0.2-bin-hadoop2.7/bin/
I was getting same error after set all path.
So you have type Space spark-shell
c:\spark> spark-shell
it will work
Follow to my step
Download JDK 8 for windows
Install Java Development envioronment
Download Spark with latest version with prebuilt Hadoop
Download WinRar for extracting
Make folder in C derive put spark folder
Go to Conf folder in Spark
Change format of log4j.propreties
Open Log4 .. in word
Replace INFO to Error
Save that file
Download Winutils
Create new folder as Winutils in C derive
Paste download winutils file in bin folder
Set Environment in Windows
Control Panel
Click on System and Security
System
Advance System Setting
Environment variables
( Set Spark Home)-New
New User_ Variables Form
Variable _Name- SPARK_Home
Path:- C:\Spark ( Spark foder in C derive)
(Set Java Home )- New
JAVA_HOME
Java Folder path –(1st java folder)
Set Hadoop path –
HADOOP_HOME
Path- C:\Wintulis
Path Directories
PATH- Edit
New- %SPARK_HOME%\bin
NEW- %SPARK_HOME%\bin
System Environment Done
You have to set the path of spark in the environment variables by following this or any other tutorials.
Another option is to go into the directory that contains the spark-shell and execute it directly.
Hope this help, Best Regards

Hadoop on Windows - "Error JAVA_HOME is incorrectly set."

I'm trying to get Hadoop running 'Local Mode' on my Windows machine. I've been using this guide: http://hadoop.apache.org/docs/r1.2.1/single_node_setup.html
When I run the command: bin/hadoop, I get the following error message:
Error: JAVA_HOME is incorrectly set. Please update
C:...\hadoop-2.7.1\conf\hadoop-env.cmd
Inside hadoop-env.cmd, I have the line:
set JAVA_HOME=%JAVA_HOME%
When I type echo %JAVA_HOME% at the command line I get:
C:\Java\jdk1.0.8_51
Even if I change the line in hadoop-env.cmd to:
set JAVA_HOME=C:\Java\jdk1.0.8_51
I get the same error...
How could it be that my JAVA_HOME is incorrectly set?
If your JAVA_HOME path contains spaces, you must use the Windows 8.3 Pathname
like the other answers, your java environment path must not contain space.
The solution is as follows:
In the cmd line, charge the directory that contain the jdk (in my case C:\Program Files\Java\jdk1.8.0_73).
execute the following line "for %I in (.) do echo %~sI" to display the short name of your installed jdk (in my case C:\PROGRA~1\Java\JDK18~1.0_7)
in the file "hadoop-env.cmd", change the line "JAVA_HOME=%JAVA_HOME%" with "JAVA_HOME=C:\PROGRA~1\Java\JDK18~1.0_7".
run again the file "hadoop-env.cmd" and it will work correctly.
set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131\
Above configuration was throwing same error as yours. I updated above with below in hadoop-env.cmd which is infact SFN
set JAVA_HOME=C:\Progra~1\Java\jdk1.8.0_131\
This allowed me to change/have different java version than that of system.
Use
"%JAVA_HOME%" in conf\hadoop-env.cmd
if your java environment path contains space, such as "C:\Program Files\java\xxxxx" , the word 《Program Files》 contains a space, so CMD can't identificate
this is the right answer
Try removing # from #rem in hadoop-env.cmd and set JAVA_HOME=%JAVA_HOME%
rem The java implementation to use. Required.
set JAVA_HOME=%JAVA_HOME%
Then try running hdfs namenode -format
This solution worked for me
Try to place the java path in double-coats. Example:
JAVA_HOME="C:\Program Files\Java\jdk-12.0.1"
It should work fine.
in hadoop-config.xml, the logic is
if not exist %JAVA_HOME%\bin\java.exe (
echo Error: JAVA_HOME is incorrectly set.
echo Please update %HADOOP_HOME%\conf\hadoop-env.cmd
goto :eof
)
if your java environment path contains space, such as "C:\Program Files\java\xxxxx" , the word 《Program Files》 contains a space, so CMD can't identificate
SO your can change the path instead.

Resources