• Post Reply Bookmark Topic Watch Topic
  • New Topic

'javac' is not recognized as an internal or external command, operable program or batch file.  RSS feed

 
Chad McAte
Greenhorn
Posts: 11
1
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok so what I have done so far using windows 10. Have created a environmental variable to point the jdk.

C:\Users\mcatee>echo %java_home%
C:\Program Files\Java\jdk1.8.0_131

Then added this to my path variable
%Java_Home%\bin;

Wow so frustrating now it works. HAHA Ok gonna post this anyways. The problem I was making was switching back and forth from
the GUI to change variables and then going back the console(command prompt) and trying to run the commands, javac. Each time you change a variable in the
GUI you need to close the console and reopen. Watched three different videos, each was different, which had me changing the variables.
Talking about path and classpath ect... really jumbled my brains a bit.

If I finally understand this please correct me if Im wrong.
Path variable simply tells the computer where the java.exe and javac.exe are located. So when the command is executed if that
.exe file doesnt exist in the current folder it then checks all the path variables for that .exe.

Ok now for CLASSPATH if I finally understand this corrected this is just java related, not system related. Use classpath when
multiple class files are located in different locations ie different folders. So like the path variable for the system, Classpath tells
Java where to locate the needed Class files.

Do I have all this correct now TY

What a frustrating 4 hours
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch Chad!

Have a cow for posting the solution and question at the same time. Trying to describe a problem does wonders for solving it!
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again I think the cow was well‑deserved. It is quite unusual for anybody to get a cow on their first post, but it has happened before.
Please can we have more details of those videos and their recommendations. We often don't have time to assess the quality of videos, and there are so many of them, of such varying quality.
If you look in our FAQ and in Oracle's installation instructions, you will find ways to set the PATH, but on close examination they are slightly different. So there are different ways to do that (as there often are in computing). When you come to use IDEs like NetBeans Eclipse or IntelliJ, you will find our method with JAVA_HOME has a slight advantage, that the IDE can identify the PATH more easily. So it would be interesting to know how the videos differ from one another.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!