Google App Engine DEFAULT_ENCODING not working in local Java environment

Following the instructions given here: https://developers.google.com/appengine/docs/java/config/appconfig#System_Properties_and_Environment_Variables To set the default encoding for UTF-8 as follows:

<env-variables> <env-var name="DEFAULT_ENCODING" value="UTF-8" /> </env-variables> 

Throws the following exception:

com.google.appengine.tools.development.EnvironmentVariableChecker $ IncorrectEnvironmentVariableException: One or more environment variables have been configured in appengine-web.xml that are missing or have different values ​​in the local environment. Instead, we recommend that you use system properties, but if you are interacting with legacy code that requires specific environment variables that have specific values, please set these environment variables in your environment before launching it. [Inconsistency environmentVariableName = DEFAULT_ENCODING environmentVariableValue = null appEngineWebXmlValue = UTF-8 appEngineWebXmlFile = C: \ xxx \ from \ artifacts \ yyy_war_exploded \ WEB-INF \ AppEngine-web.cheogle.geogle.geogle.geogle.gele.ml (EnvironmentVariableChecker.java:75)

I tried this:

 -DDEFAULT_ENCODING=UTF-8 

And this:

 -Dfile.encoding=UTF-8 

In the server startup configuration and

 JAVA_TOOLS_OPTIONS=-Dfile.encoding=UTF-8 -DDEFAULT_ENCODING=UTF-8 

I am using Windows 8 pro and Intellij Ultimate

Please, help

+4
source share
3 answers

I had the same problem. Solved it by creating the following Enviroment variable: Default_encoding = UTF-8

Part:

 <env-variables> <env-var name="DEFAULT_ENCODING" value="UTF-8" /> </env-variables> 

not required in your appengine-web.xml

Bonus help if necessary: https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them

+1
source

I had the same problem on Mac and the following line worked:

 export DEFAULT_ENCODING="UTF-8" 

before starting the local server, fixed it.

Unfortunately, I'm not sure what the equivalent command is in Windows.

0
source

Windows environment variables can be set from:

Control Panel-> All Control Panel Elements-> System-> Environment Variables

Variable: DEFAULT_ENCODING Value: UTF-8

After setting the value, you must restart the IDE.

0
source

Source: https://habr.com/ru/post/1501499/


All Articles