Project structure
Project Name--|--classes
|--lib
|--startup.bat
@echo off
:: Several parameters that need to be modified
Set Arg0=xxx
Set Arg1=xxx
Set Arg2=xxx
Set Dir=xxx
:: Modify DOS code to UTF-8
Chcp 65001
Set java_home=c:\java\jdk1.7.0_67\
Set classpath=.;
For%%c in (Lib\*.jar) do set classpath=!classpath!; %%c
Set classpath=%classpath%;. /classes;%java_home%\jre\lib\rt.jar;%java_home%\lib\dt.jar;%java_home% \lib\tools.jar
Set _java_options= "-dfile.encoding=utf-8"
Java%_java_options%-djava.ext.dirs=%dir%/lib-cp%classpath% com.asiainfo.biframe.test.Test%arg0%%arg1%%arg2%
Pause
My garbled problem solved:
DOS scripts, DOS command line encoding, program encoding (including configuration) are all set to Utf-8;
BAT Script Execution Flashback:
1) The script initially has grammatical problems;
2) cmd execution also has a flashback situation, because I changed the code to Utf-8 after the change of the font, I changed to the dot matrix font when it is often wrong.
The above process is very brief, although it has been a long time to troubleshooting, debugging, in fact, only because of the DOS unfamiliar.
I hope that my lessons can be used as a future teacher for reference and study.
Thank You and myself!
Dos Write a simple script + garbled problem