Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Encoding format to java in shell Script

Tags:

java

linux

shell

I have a shell script which runs My Java Application.Now i want to specify encoding format "UTF8" to my java application using shell script can any one help.I am using mac os.

Thanks
Ganesh

like image 624
Ganesh Avatar asked Dec 13 '10 05:12

Ganesh


1 Answers

Try

//invoking the compiler when your source code contains naked UTF-8 characters.
javac.exe -encoding UTF-8  MyClass.java

and

//setting the default encoding on the command line
java.exe "-Dfile.encoding=UTF-8" -jar myprog.jar

source: http://mindprod.com/jgloss/encoding.html

like image 166
athspk Avatar answered Sep 21 '22 18:09

athspk