Problems with ANT installation - java

Please excuse my french english ^^
I have got a probleme with the ANT installation...
I've download the ANT Zip on the apache website
I've set the environment variable ANT_HOME to : C:\Program Files\apache-ant-1.8.4
I've set the environment variable JAVA_HOME to : C:\Program Files\Java\jdk1.7.0_07
I've add, in the PATH variable : C:\Program Files\apache-ant-1.8.4\bin
But when I want to test the "ant" or "ant -version" command in the CMD, I've have got this error : (in french for me :P, I have translate for you :D)
“ant” is not recognized as an internal or external command, operable program or batch file.
Have you got an idea ?
I have to install this program to use "zxing" on Android :)
Thanks !

Change in the PATH environment variable are not applied on opened command line.
If you just changed the PATH, you need to open a new command line terminal. You can check by typing echo %PATH%.

Related

java -cp/javac doesn't work in cmd prompt

I am trying to run mo program by cmd :
first i try to compile my Main.java by "javac Main.java", after that i have no msg in cmd
second i run "java -cp Main"(Main.class with byte code), after that i have no output in cmd
I tryed reinstall my JDK, but it doesn't help. also when i run "java -version" in cmd i have no output. and no msg.I has set my JAVA_HOME path into JDK dir and set him into my PATH "%JAVA_HOME\bin". what i cant do wrong? Pls help
Your path environment variable for java is not set correctly. You could try to run the command where java and most likely it will return a path that is not correct (or nothing).
Find the correct path where your JDK is installed and run this command to add it to the path vars in cmd:
set PATH=%PATH%;C:\your\path\here\
An example for my system and path would be:
set PATH=%PATH%;C:\Program Files\Java\jdk-11\bin
After setting this path variable, close and reopen your cmd window and try running java -version again.
If it still doesn't show anything then you have to manually change your path variables and remove the old path.
Make sure that you have correctly set the path to the directory in which you have your java installed. For instance mine is settled in D:\Program files\java\jdk-11.0.2
Subsequently I set JAVA_HOME as
Then you open path variable and new entry as following:
Then save all changes. Close all running cmd, start it again and then retry java -version

Run jps on command promt

I installed Hadoop and tried to run it. The terminal shows that everything has been started but when I run jps command it shows :
'jps' is not recognized as an internal or external command,
operable program or batch file.
I set JAVA_HOME= C:\Progra~1\Java\jre1.8.0_261 and path = C:\Progra~1\Java\jre1.8.0_261\bin and C:\Program~1\Java\jre1.8.0_261\legal\jdk in enviroment, but when I type jps in command prompt it shows : Not recognized as an internal or external command.
I don't know what can I do, Help me, please.
It looks like the jps executable is no present in the bin directory that you've specified in system environment variable. It should be inside C:\Program Files\Java\jdk1.8.0_261\bin if you have jdk1.8.0_26 installed in your system in the location C:\Program Files. Try specifying the JAVA_HOME like this:
Go to Control Panel -> System -> Advanced System Settings -> Environment Variables.
Add a new path variable called JAVA_HOME:
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_261
Select Path from System Variables and click Edit.
Remove the existing Java path and add the new path as %JAVA_HOME%\bin
Now, open command window, type jps and hit ENTER.
Note: You can download JDK from here

Unable to set Java Path in system variables (Windows 10)

I've tried adding JAVA_HOME with the directory - C:\Program Files\Java\jdk1.8.0_121 to my system variables, and then adding %JAVA_HOME%/bin to Path variable and this didn't work and I receive
'java' is not recognized as an internal or external command, operable
program or batch file.
So I've tried adding C:\Program Files\Java\jdk1.8.0_121; directly to the path variable but I still get the above error. Does anyone have any suggestions please?
Thanks
PS - The image shows me in the command prompt at C:\Program Files\Java\jdk1.8.0_121 trying 'java -version' - I just moved up one dir to test the variable, entering 'java -version' in the bin directory returns the correct info, as you would expect.
Did you try closing that command prompt and reopening it?
In the command line, run the following:
set PATH=%PATH%:C:\Program Files\Java\jdk1.8.0_121\bin
Without exiting the shell, run your java commands
E.g.
java -version
This will surely work.

Windows 7 command line jps not working

Others have asked this question but the answer is usually the same and not helpful to my problem. I installed JDK, and added C:\Program Files\Java\jdk1.7.0_25\bin to the path system variable. I checked, jps.exe is in that directory. I restarted my computer but still have had no luck. When I run jps I get the error:
'jps is not recognized as an internal or external command, operable command or batch file'
When I run C:\Program Files\Java\jdk1.7.0_25\bin\jps.exe on the command line it works fine. Working in Windows 7.
Mildly obvious mistake, but I realize that I had spaces in between the directories in my path and that caused them to not be recognized. So I had %OTHER_PATH%; C:\Program Files\Java\jdk1.7.0_25; %ANOTHER_PATH%, which I just had to switch to %OTHER_PATH%;C:\Program Files\Java\jdk1.7.0_25;%ANOTHER_PATH%
Your JDK bin directory does not exist in PATH variable.
To add this you need to do below steps.
Go to "Control Panel >> System >> Advanced system settings >>
Environment Variables
Click 'Path' from System variables
Click Edit.
Now add the path "C:\Program Files\Java\jdk1.8.0_72\bin"
Now open command window and write jps. It will work now.
In addition to the above solutions, still if you have issue with jps command, Please check whether the default system installed java(JRE) path is already available in the Path variable.
My case i faced the same issue and observed the following path already available in the path variable.
"C:\Program Files (x86)\Common Files\Oracle\Java\javapath"
So I had to change the position(move up) of my new JAVA_HOME path, new JAVA_HOME path is above the default oracle javapath.

Javac Command Not Working

My javac command is not working.
"javac is not recognized as an internal or external command, operable program or batch file."
-java version WORKS
I've tried setting classpath successfully in command prompt. SET CLASSPATH "C:\Program Files\Java\jdk1.7.0_09\bin";
Ive adding it in environment variables. ;C:\Program Files\Java\jdk1.7.0_09\bin ;C:\Program Files\Java\jre7\bin
Ive checked the bin folder java.exe is there aswell as javac.exe.
^ Tried all of these still doesn't work. I've also restarted command prompt still does not not work.
Why is not working?
You're using the correct path apparently, but you should assign it to the PATH variable, not to the CLASSPATH variable.
You're trying to set the access path to the executable files, not to the class files.
Just do this
In the same dialog, make sure that JAVA_HOME exists in your user variables or in the system variables and it is set to the location of your JDK,
e.g. C:\Program Files\Java\jdk1.5.0_02 and that %JAVA_HOME%\bin is in your Path environment variable.
Just set JAVA_HOME to
C:\Program Files\Java\jdk1.7.0_09
After adding the path to the jre7\bin-Folder to the PATH-Variable, you need to restart your Computer in most cases.
Did you tried to create a JAVA_HOME variable? The value should be the path of the java without the bin.
Also, try to open Eclipse.
If nothing helps, the last thing that you can do is install netbeans, it will configurate everything.

Categories

Resources