在shell脚本中将编码格式设置为java

Gan*_*esh 7 java linux shell

我有一个运行My Java Application的shell脚本.现在我想使用shell脚本向我的java应用程序指定编码格式"UTF8"可以任何一个帮助.我正在使用mac os.

谢谢
Ganesh

ath*_*spk 13

尝试

//invoking the compiler when your source code contains naked UTF-8 characters.
javac.exe -encoding UTF-8  MyClass.java
Run Code Online (Sandbox Code Playgroud)

//setting the default encoding on the command line
java.exe "-Dfile.encoding=UTF-8" -jar myprog.jar
Run Code Online (Sandbox Code Playgroud)

来源:http: //mindprod.com/jgloss/encoding.html