【问题标题】:Google plugin for Eclipse: how to add JVM arguments in the Run configurationEclipse 的 Google 插件:如何在运行配置中添加 JVM 参数
【发布时间】:2013-01-02 17:15:42
【问题描述】:

我需要在 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.

我做错了什么?

【问题讨论】:

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


    【解决方案1】:

    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
    

    这应该可以解决您的问题。

    【讨论】:

    • 这是工作,但我添加的参数在下次运行配置时会被删除。
    • 这可能是 Google Plugin for Eclipse 中的一个错误,我提出了一个问题 here
    • 好。看来我是世界上唯一一个在使用它的人:-)
    猜你喜欢
    • 1970-01-01
    • 2013-03-09
    • 1970-01-01
    • 2014-12-19
    • 1970-01-01
    • 1970-01-01
    • 2014-08-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多