JAVA is widely used, and setting JAVA_HOME is a common task as a developer. There are many articles on the setting procedure on Windows. This time, I will explain the setting of the path with spaces.
Variable name: JAVA_HOME Path: C: \ Program Files \ Java \ jdk1.8.0_201
If you do not change the path when installing JAVA, it will be installed in "C: \ Program Files \ Java". Since there is a space in the "Program Files" folder, it may be strange due to the path when executing with the command. Error example:
The best way is to select a folder with no space and no Japanese when installing.
In the case of "Program Files", there are the following plans.
"" C: \ Program Files \ Java \ jdk1.8.0_201 "" Set the path like this
This often solves the problem, but in some cases it cannot be used.
If you execute it with the dir / x command, you can see the short folder name.
In the above path, if you set the following path, you can avoid the influence of the path with the base. C:\Program Files\Java\jdk1.8.0_201」 ⇒ C:\Progra~1\Java\jdk1.8.0_201
You can use javac and java commands by adding "% JAVA_HOME% \ bin" to the path variable.
that's all