[Java] PATH does not pass… Character code is the cause

1 minute read

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

Command Prompt 2020_07_04 10_41_14.png

Well, even if I recheck the environment variable settings, I see no mistakes. So I thought it might be a character code problem, and when I checked the character code of the input path, 2020-07-04.png

Apparently, the circle 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 a yen mark, but a backslash tentative figure. (To be exact, you can also enter a circle mark) The reason why this happens is that in Japan, the circle mark was assigned to the character code of 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 in the whole world, the Unicode standard was born, and it was necessary to properly define the backslash and the yen mark. At that time, a backslash is assigned to U+005C and a yen mark is assigned to U+00A5. However, when Windows was converted to Unicode, “U+005C has a backslash character code, but it is a yen mark in Japanese display”. Therefore, if you type 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 though the typed characters are displayed as yen marks, they are really backslashes (character code is U+005C). However, when I copy and copy it from somewhere, I sometimes bring a real circle mark (character code is U+00A5).

By the way, the explanation became longer, but in my case this time I was copying and setting the path, so (for some reason) I used a real circle mark. So, if you input it properly from the keyboard and set the environment variable, Selected command prompt 2020_07_04 10_45_52.png

In this way, the javac command was successfully executed.