2

When I started learning Java I was always asked to set the environment variable PATH before using the compiler. Now, I know why I have to do so.

But why does the Java installation wizard not do it by itself as other software do?

EDIT: Before this question gets closed as primarily opinion based; I'm looking for an authoritative answer, from one of the Oracle folks here.

Lasitha Yapa
  • 4,309
  • 8
  • 38
  • 57
  • 2
    Did every software you installed do it ? This would lead to a messy Path. Java probably let you do it only if you need it (this is not always necessary) – AxelH Dec 30 '16 at 06:10
  • 1
    This is a question i've always asked myself. Each JDK update also means manually setting the variables. At least the wizard should give an option for that. – Mordechai Dec 30 '16 at 06:31
  • 1
    You'd probably have to ask the Java guys at Oracle, but I guess one aspect that plays into this is that one can possibly install several different versions of the JDK & JRE. How would one JDK version's installer know whether it should have precedence over other (already installed) versions and thus adjust your PATH? Granted, it could ask you about it. But then it should probably also remove other versions from PATH in order to not turn that into a junkyard, not sure whether that could be done automatically. – stakx - no longer contributing Dec 30 '16 at 06:36
  • 2
    @staks It could do it nicely by setting %JAVA_HOME% as the path variable, and adjust _that_on every update. – Mordechai Dec 30 '16 at 06:41
  • Just to clarify: This is just for convenience, you _can_ use the jdk tools without setting the path, but you'll have to type the full name of that tool, like C:\Program Files\Java\... – Mordechai Dec 30 '16 at 06:45
  • 1
    http://stackoverflow.com/questions/560797/why-doesnt-the-java-sdk-installer-set-java-home – Mordechai Jan 08 '17 at 23:06
  • @MouseEvent: you don’t have to use the full path every time. You can set the path within one console window locally. And to another JDK in another. – Holger Jan 13 '17 at 19:57

0 Answers0