eclipse - 当我尝试在 Eclipse 中运行我的项目时,为什么找不到我的 VM 参数的路径?

标签 eclipse virtual-machine java jvm-arguments

我有几个 .properties 文件希望 Eclipse 获取。根据安装 ESAPI 的说明,它说我可以通过执行以下操作将它们添加到我的项目中:

在 Eclipse 中,我将转到“窗口”>“首选项”>“Java”>“已安装的 JRE”

从那里我选择唯一的选项 jre7 并单击“编辑...”按钮。

在“默认 VM 参数:”框中,我输入了以下内容:

-D org.owasp.esapi.resources="c:\.esapi"

但是,当我尝试运行我的项目时,出现以下错误:

Error: Could not find or load main class org.owasp.esapi.resources=c:\.esapi

即使目录和文件就在那里。我尝试过其他地方但没有运气。有什么想法吗?

更新:当我尝试时:

-Dorg.owasp.esapi.resources="c:\.esapi"

我只是得到这个输出,就好像它不喜欢所使用的选项:

Usage: javaw [-options] class [args...]
           (to execute a class)
   or  javaw [-options] -jar jarfile [args...]
           (to execute a jar file)
where options include:
    -d32      use a 32-bit data model if available
    -d64      use a 64-bit data model if available
    -server   to select the "server" VM
    -hotspot      is a synonym for the "server" VM  [deprecated]
                  The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
              A ; separated list of directories, JAR archives,
              and ZIP archives to search for class files.
-D<name>=<value>
              set a system property
-verbose[:class|gc|jni]
              enable verbose output
-version      print product version and exit
-version:<value>
              require the specified version to run
-showversion  print product version and continue
-jre-restrict-search | -no-jre-restrict-search
              include/exclude user private JREs in the version search
-? -help      print this help message
-X            print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
              enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
              disable assertions with specified granularity
-esa | -enablesystemassertions
              enable system assertions
-dsa | -disablesystemassertions
              disable system assertions
-agentlib:<libname>[=<options>]
              load native agent library <libname>, e.g. -agentlib:hprof
              see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
              load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
              load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
              show splash screen with specified image

参见http://java.sun.com/javase/reference了解更多详情。

最佳答案

-D org.owasp.esapi.resources="c:\.esapi"
  ^

看到 -D 和其余部分之间的空格了吗?删除它。

-Dorg.owasp.esapi.resources="c:\.esapi"

-D 后面没有空格,而是直接跟您想要定义的内容。

关于eclipse - 当我尝试在 Eclipse 中运行我的项目时,为什么找不到我的 VM 参数的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8191282/

相关文章:

java - 登录失败

virtual-machine - 无法从虚拟机连接到互联网

java - 将分析和日志记录视角添加到 RedHat 上的 Eclipse

linux - 在 Mac 上组装

ruby-on-rails - 在 VM Vagrant Box 中创建 Windows 上的 Ruby on Rails 环境

java - 普通话和粤语是否有单独的 Java 语言环境?

java - 使用 Java 的 Locale 框架来表示中土世界的最佳方式是什么?

java - 在 Spring 中使用 SimpleJdbcCall 调用返回行的 Oracle 过程

android - 该项目未构建,因为其构建路径不完整

eclipse - 在 Eclipse 中调试之前运行 Ant 任务