Eclipse的Google插件:如何在Run配置中添加JVM参数

时间:2013-01-18 21:59:20

标签: java eclipse google-app-engine google-plugin-eclipse

我需要在文本框程序参数中的参数选项卡上为我的App Engine运行配置添加参数,如https://developers.google.com/appengine/docs/java/cloud-sql/developers-guide中所述

 --jvm_flag=-Drdbms.server=local
 --jvm_flag=-Drdbms.driver=com.mysql.jdbc.Driver
 --jvm_flag=-Drdbms.url=jdbc:mysql://localhost:3306/yourdatabase?user=username&password=password 

但我总是得到,快速错误:

Usage: <dev-appserver> [options] <app directory>

Options:
 --help, -h                 Show this help message and exit.
 --server=SERVER            The server to use to determine the latest
  -s SERVER                   SDK version.
 --address=ADDRESS          The address of the interface on the local machine
  -a ADDRESS                  to bind to (or 0.0.0.0 for all interfaces).
 --port=PORT                The port number to bind to on the local machine.
  -p PORT
 --sdk_root=DIR             Overrides where the SDK is located.
 --disable_update_check     Disable the check for newer SDK versions.
 --generated_dir=DIR        Set the directory where generated files are created.
 --jvm_flag=FLAG            Pass FLAG as a JVM argument. May be repeated to
                              supply multiple flags.

我做错了什么?

1 个答案:

答案 0 :(得分:0)

Run Configurations - Arguments中,将以下jvm_flag参数添加到VM arguments部分,而不是Program arguments部分:

-Drdbms.server=local
-Drdbms.driver=com.mysql.jdbc.Driver
-Drdbms.url=jdbc:mysql://localhost:3306/yourdatabase?user=username&password=password

这可以解决您的问题。