Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google App Engine DEFAULT_ENCODING fails in local environment Java

Following Instructions detailed here: https://developers.google.com/appengine/docs/java/config/appconfig#System_Properties_and_Environment_Variables To set the Default Encoding to UTF-8 like so:

<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 have missing or different values in your local environment. We recommend you use system properties instead, but if you are interacting with legacy code that requires specific environment variables to have specific values, please set these environment variables in your environment before running. [Mismatch environmentVariableName=DEFAULT_ENCODING environmentVariableValue=null appEngineWebXmlValue=UTF-8 appEngineWebXmlFile=C:\xxx\out\artifacts\yyy_war_exploded\WEB-INF\appengine-web.xml] at com.google.appengine.tools.development.EnvironmentVariableChecker.check(EnvironmentVariableChecker.java:75)

I have tried this:

-DDEFAULT_ENCODING=UTF-8

And this:

-Dfile.encoding=UTF-8

On the server launch configuration and

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

I'm using Windows 8 pro and Intellij Ultimate

Please help

like image 406
unify Avatar asked Nov 12 '22 22:11

unify


1 Answers

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

The part:

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

is not needed in your appengine-web.xml

Bonus help in case it is needed: https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them

like image 83
akafkis Avatar answered Nov 14 '22 22:11

akafkis