Google App Engine DEFAULT_ENCODING在本地环境Java中失败 [英] Google App Engine DEFAULT_ENCODING fails in local environment Java

查看:211
本文介绍了Google App Engine DEFAULT_ENCODING在本地环境Java中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下详细说明:
https://开发人员.google.com / appengine / docs / java / config / appconfig #System_Properties_and_Environment_Variables
将默认编码设置为UTF-8,如下所示:

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>

引发以下异常:


com.google.appengine.tools.development.EnvironmentVariableChecker $ IncorrectEnvironmentVariableException:

appengine-web.xml中配置了一个或多个环境变量,这些变量在您的值中丢失或不同本地
环境。我们建议您使用系统属性,但如果
与需要特定
环境变量的遗留代码进行交互以获得特定值,请在运行前在您的环境中设置这些
环境变量。 [不匹配
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)

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)

我试过这个:

-DDEFAULT_ENCODING=UTF-8

这就是:

-Dfile.encoding=UTF-8

在服务器启动配置和

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

我正在使用Windows 8专业版和Intellij Ultimate

I'm using Windows 8 pro and Intellij Ultimate

请帮助

推荐答案

我遇到了同样的问题。
通过创建以下环境变量解决它:
DEFAULT_ENCODING = UTF-8

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

部分:

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

在需要时提供帮助:
https://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-或者使用它们

这篇关于Google App Engine DEFAULT_ENCODING在本地环境Java中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆