Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of cmd changing JDK default Encoding to UTF-8

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article to share with you is about cmd change JDK default encoding for UTF-8 example analysis, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after harvest, not much to say, follow Xiaobian to see it.

Set a java variable when using it on the command line

set JAVA_TOOL_OPTIONS=-Dfile.encoding=utf-8 -Duser.language=en -Duser.country=US

Compiling JAVA files from the command line

javac -d ../ *.java

The.CLASS file format thus generated is also UTF-8 encoded.

Also before executing java or jar packages, set a temporary or permanent variable

set JAVA_TOOL_OPTIONS=-Dfile.encoding=utf-8 -Duser.language=en -Duser.country=US

This ensures that your program is running in UTF-8 format.

The first step javac *.java must have the suffix.java, if the name on the singles will be reported incorrectly, as above;

Java Variable Java+ name is enough.

This time you do not need to enter javac -enconding UTF-8 *.java every time you execute, you can directly enter java *.java, but after each enter, you will execute one more line, as follows:

The above is an example analysis of cmd changing JDK default encoding to UTF-8. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report