Setting the default Java character encoding

后端 未结 17 1774
终归单人心
终归单人心 2020-11-21 06:09

How do I properly set the default character encoding used by the JVM (1.5.x) programmatically?

I have read that -Dfile.encoding=whatever used to be the

17条回答
  •  無奈伤痛
    2020-11-21 07:05

    My team encountered the same issue in machines with Windows.. then managed to resolve it in two ways:

    a) Set enviroment variable (even in Windows system preferences)

    JAVA_TOOL_OPTIONS
    -Dfile.encoding=UTF8

    b) Introduce following snippet to your pom.xml:

     -Dfile.encoding=UTF-8 
    

    WITHIN

     
     -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
     -Dfile.encoding=UTF-8
     
    

提交回复
热议问题