I don't know if it will continue, but I tried to make it a continuation-like title.
Java that I have never experienced before. Java that I have a little admiration for. When I thought I could finally challenge this time, I was taken to another person in front of me. So, I started studying Java voluntarily because I was disappointed.
Easy introduction to Java DAY5: Error: This character cannot be mapped to encoding MS932
Anyway, I thought it would be easy to get started, so first of all, the reference site "Introduction to Java" After preparing the environment according to the procedure, an error occurred when I thought about "Hello World". The cause was a difference between the JDK and JRE versions. This could be dealt with by changing the order of the environment variables. (There were multiple JREs in different versions on my PC)
Next, if you want to compile a program that contains Japanese An error occurred again.
The cause seems to be a difference in the character code, and this was also solved by specifying the character code at compile time, referring to the reference site "DAY5: Error: This character cannot be mapped to the encoding MS932".
Error: This character (0xEF) cannot be mapped to encoding windows-31j Cause: Difference in character code Workaround: Compile with "-encoding UTF-8"
javac -encoding UTF-8 Scores.java
Java that I couldn't get my hands on until now. I finally understood the meaning of saying "Because the Java version is different" in the distance. It's hard to experience in business, but I hope I can continue in detail.
Recommended Posts