How to set the JVM Encoding?

When we execute a maven goal in command line, the default JVM encoding is determined by the operating system.

Example : default JVM encoding for Windows Operating System is Cp1252.

It is possible to specify the JVM encoding in the MAVEN_OPTS environment variable. The options defined in this variable are used by the JVM in Maven launch.

If you are executing your Maven goal through the m2eclipse plugin, the default JVM encoding is determined by the Eclipse workspace encoding.

Note : the Eclipse workspace encoding can be configured as follow:

· On Eclipse, goes to « Window > Preferences »

· Open the « General » menu, and the « Workspace » under-menu.

· In the « Text file encoding » zone :

® Check « Other »

® Select the wishing encoding