I tried typing the name of the bat file (makejar.bat) from the containing direcory from the command line. It gives several errors all containing "'javac' is not recognised as an internal or external command."
Asked
Active
Viewed 366 times
0
-
could you show us the contents of the .bat file in question? – Richard Christensen Oct 03 '13 at 14:45
-
1Is your java CLASSPATH set? – Andre Lombaard Oct 03 '13 at 14:45
-
That suggests that your `bat` file contains errors. – Niet the Dark Absol Oct 03 '13 at 14:45
-
I don't know @user65439 – George Tomlinson Oct 03 '13 at 14:46
-
how do I do that? @Tim Cooper / user65439 – George Tomlinson Oct 03 '13 at 14:46
-
possible duplicate of [How can I set the PATH variable for javac so I can manually compile my .java works?](http://stackoverflow.com/questions/2079635/how-can-i-set-the-path-variable-for-javac-so-i-can-manually-compile-my-java-wor) – Oct 03 '13 at 14:46
-
1Check how to add the environment variable [here](http://docs.oracle.com/javase/tutorial/essential/environment/paths.html), and then it will work (if there aren't more errors). – Juan Oct 03 '13 at 14:48
-
followed instructions for adding the environment variable- still get same errors @Juan – George Tomlinson Oct 03 '13 at 15:01
-
1@bluesh34 keep in mind you may need to restart the machine. And another important question have you installed JDK? Show us the .bat content if possible – Juan Oct 03 '13 at 15:07
-
What happens if you type the following into the command prompt: java -version – Andre Lombaard Oct 03 '13 at 15:08
-
tried repeating those instructions and it works now, so must have done something wrong first time- thanks – George Tomlinson Oct 03 '13 at 15:12
3 Answers
1
This sounds like a java class path problem.
You can find the instructions to set the java CLASSPATH on the following Oracle web page.

Andre Lombaard
- 6,985
- 13
- 55
- 96
-
followed these instructions for adding the environment variable- still get same errors – George Tomlinson Oct 03 '13 at 15:02
-
What happens if you type the following into the command prompt: java -version – Andre Lombaard Oct 03 '13 at 15:08
-
Actually, I just repeated the instructions and it works, so maybe I did something wrong first time – George Tomlinson Oct 03 '13 at 15:10
1
I suppose you are working on Windows, so make sure that your environment variables are properly set:
JAVA_HOME - points to a proper JDK installation
PATH - contains a references to JAVA_HOME, something like: **PATH;%JAVA_HOME%\bin**
This should do it! Make sure to restart the command line you are using after making changes to environment variables.
You can see how to set/add environment variables on windows here.

Olimpiu POP
- 5,001
- 4
- 34
- 49
0
On CMD--> type--> PATH="c:\Program Files\Java\jdk1.8.0_144\bin"; and then check java path by type "java -version" on cmd and also check on YouTube : -https://www.youtube.com/watch?v=mzAAmJj-W6w

Sahil Infotech
- 1
- 2
-
A link to an outside source is not the same as an answer. Please consider adding key details from the video to your answer. – Thomas Smyth - Treliant Dec 04 '17 at 06:56