Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么可以';t我的VM参数';当我尝试在Eclipse中运行项目时,找不到的路径?_Eclipse_Virtual Machine_Java_Jvm Arguments - Fatal编程技术网

为什么可以';t我的VM参数';当我尝试在Eclipse中运行项目时,找不到的路径?

为什么可以';t我的VM参数';当我尝试在Eclipse中运行项目时,找不到的路径?,eclipse,virtual-machine,java,jvm-arguments,Eclipse,Virtual Machine,Java,Jvm Arguments,我有几个.properties文件,我想让Eclipse获取。根据安装ESAPI的说明,我可以通过执行以下操作将它们添加到我的项目中: -D org.owasp.esapi.resources="c:\.esapi" 在Eclipse中,我将进入窗口>首选项>Java>安装的JRE 从那里我选择我唯一的选项jre7并点击编辑。。。按钮 在默认VM参数:框中,我键入了以下内容: -D org.owasp.esapi.resources="c:\.esapi" 然而,当我尝试运行我的项目时,我得

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

-D org.owasp.esapi.resources="c:\.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
用法:javaw[-options]类[args…] (执行一个类) 或javaw[-options]-jar-jarfile[args…] (执行jar文件) 其中包括: -d32使用32位数据模型(如果可用) -d64使用64位数据模型(如果可用) -选择“服务器”虚拟机的服务器 -hotspot是“服务器”VM的同义词[已弃用] 默认VM是服务器。 -cp -类路径 A.单独的目录列表、JAR归档、, 和压缩档案以搜索类文件。 -D= 设置系统属性 -详细[:类| gc | jni] 启用详细输出 -版本打印产品版本并退出 -版本: 需要指定的版本才能运行 -showversion打印产品版本并继续 -jre限制搜索|-无jre限制搜索 在版本搜索中包括/排除用户专用JRE -? -帮助打印此帮助消息 -关于非标准选项的X打印帮助 -ea[:…|:] -启用评估[:…|:] 启用具有指定粒度的断言 -da[:…;:] -取消分配[:…|:] 禁用具有指定粒度的断言 -esa |-启用系统断言 启用系统断言 -dsa |-禁用系统断言 禁用系统断言 -agentlib:[=] 加载本机代理库,例如-agentlib:hprof 另请参见-agentlib:jdwp=help和-agentlib:hprof=help -代理路径:[=] 按完整路径名加载本机代理库 -javaagent:[=] 加载Java编程语言代理,请参阅Java.lang.instrument -飞溅: 用指定的图像显示启动屏幕 有关更多详细信息,请参阅

-D org.owasp.esapi.resources="c:\.esapi"
  ^
看到
-D
和其余部分之间的空格了吗?去掉那个

-Dorg.owasp.esapi.resources=“c:\.esapi”


-D
后面没有空格,而是直接跟在你想要定义的东西后面。

我不知道为什么,但我可以告诉你Eclipse将你的JVM选项
-D org.owasp.esapi.resources=“c:\.esapi”
解释为“主类”。。。i、 e.包含
公共静态main
方法的类

我猜-D选项(用于定义符号)在执行JVM时没有得到Ecriples(ha)的认可或尊重

我希望其他人能够补充关于Eclipse如何准确执行JVM的知识


干杯。Keith.

您使用的是哪个版本的Eclipse?如果有关系;-)说得好。EclipseJavaEE1.4.1.2Yup,这很有帮助。它与其他一些东西结合在一起,但帮助我解决了这个问题。非常感谢。