0

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.

3
  • Did you actually install JDK on Mac? Because if it is included in the system (openjdk?) the PATH variable should be properly set. In Windows the JDK is not included so you have to set it manually Commented Oct 27, 2013 at 18:13
  • After installing the JDK in Windows, follow the step Updating the PATH Environment Variable (Optional) from here: docs.oracle.com/javase/7/docs/webnotes/install/windows/… Commented Oct 27, 2013 at 18:17
  • yes, I did install jdk on Mac w/o any problems Commented Oct 27, 2013 at 18:23

1 Answer 1

1

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.