[JAVA] PATH does not pass ... The cause is the character code

I installed the JDK on my new PC and set the environment variables. Then execute the javac command ...

コマンド プロンプト 2020_07_04 10_41_14.png

Well, I can't find any mistakes when I recheck the environment variable settings. I thought that it might be a character code problem, so I checked the character code of the entered path. 2020-07-04.png

Apparently, the yen mark was ** U + 00A5 ** instead of ** U + 005C **. In the first place, the yen mark we are typing on the Japanese keyboard of Windows is not actually a yen mark, but a ** temporary backslash figure **. (To be precise, you can also enter a yen mark) The reason why this happens is that in Japan, the yen mark was assigned to the character code 5C, which was originally assigned the backslash character in ASCII, and it was standardized as JIS X 0201. After that, by trying to unify the character codes all over the world, the Unicode standard was born, and I tried to define the backslash and the yen mark properly. At that time, a backslash is assigned to ** U + 005C ** and a yen mark is assigned to ** U + 00A5 **. However, when Windows converted to Unicode, he said, "The character code of U + 005C is a backslash, but it is a yen mark in Japanese display." Therefore, when you enter a backslash with a Japanese keyboard, a yen mark or a backslash may be displayed on the screen depending on the font. (Actually backslash) In other words, when we usually type with a Japanese keyboard, even if the characters we type are displayed as yen marks, they are ** really backslashes ** (character code is U + 005C). However, when you copy and paste from somewhere, you may bring a real yen mark (character code is U + 00A5).

Well, the explanation is long, but in my case this time I copied and set the path, so (for some reason) I used the real yen mark. So, if you input it properly from the keyboard and set the environment variable, 選択コマンド プロンプト 2020_07_04 10_45_52.png

In this way, the javac command was successfully executed.

Recommended Posts

PATH does not pass ... The cause is the character code
Until the code is executed
[Java] com.sun.glass.WindowEvent is imported and the window does not close
Guess the character code in Java
Correspond to "error that basic authentication does not pass" in the test code "The story that could not be done"
Is the path helper (_path) returning a relative path? Absolute pass? : Rails tutorial memorandum
The application absorbs the difference in character code
What is the model test code testing
A story that suffered from a space that does not disappear even if trimmed with Java The cause is BOM
Setting method that the size does not change even if CSS is changed
ActiveSupport underscore is not the inverse of camelize
The devise error message is not displayed properly.
Does the escape sequence (\) not work? (for Mac)
The story that link_to is deep (cause unknown)
GoogleMap is not displayed until the browser is reloaded
Eclipse does not start after Java 11 is installed
The public key for jenkins-2.249.1-1.1.noarch.rpm is not installed
Does not recognize the library when implementing jcaptcha
When the project is not displayed in eclipse
Ebean.update () is not executed in the inherited model.
[Railways] Railways does not work when the RubyMine project root is other than the Rails root directory.
What to do if the breakpoint is shaded and does not stop during debugging