Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

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

Posts: 11
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

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
author & internet detective
Posts: 41937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
Posts: 79530
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
The glass is neither half full or half empty. It is too big. But this tiny ad is just right:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic