Why did I need to add PATH Env. variable for the user in Windows to run javac?

I just switched for a while from MacOS to Windows and I could not simply install JDK and run javac on Windows as I did with MacOS. Before running javac I needed to add new Environmental Variable for my user (with name PATH and the actual path to bin folder for jdk).

Why did I run javac w/o any problems on MacOS, but I needed to add env. variable to Windows? Thanks.

Upvotes: 0

Views: 111

Answers (1)

Patrick B.
Patrick B.

Reputation: 1267

I don't know how it is on Mac OS, but on Windows javac is just a simple executable program. As any other program which is called from the command line, you have to tell the OS where to find it, so that you can call it without specifying its path each time you use it.
To sum up, if you don't update the path environnement variable, you'll have to speficy where the javac program is located each time you want to use it. But if you update the path environnement variable, you won't need to do that(you'll just call the program)

Upvotes: 1

Related Questions