简体   繁体   English

从命令行使用evosuite

[英]using evosuite from command line

When I try to use the EvoSuite testing tool from the command line, I get the following error: 当我尝试从命令行使用EvoSuite测试工具时,出现以下错误:

Fatal crash on main EvoSuite process. Class using seed 1428172877144. Configuration id : null 
java.lang.RunTimeExceptionConfiguration:Did not manage to automatically find tools.jar. Use –Dtools_jar_location = <path> properly 
    at org.evosuite.runtime.agent.ToolsJarLocator.getLoaderForToolsJar<ToolsJarLocator.java:71> ~[evosuite-0.1.1.jar:na] 
    at org.evosuite.Evosuite.parseCommandLine<Evosuite.java:152> ~[evosuite-0.1.1.jar:na] 
    at org.evosuite.Evosuite.main<Evosuite.java:304> ~[evosuite-0.1.1.jar:na]

Could someone help me with this? 有人可以帮我吗?

将tools.jar从JDK复制到您的JRE lib文件夹...对我有用。.问题是,它无法找到tools.jar。

Make sure you use your JDK to run Evosuite, not the JRE. 确保使用JDK运行Evosuite,而不是JRE。 That may mean either going into the JDK /bin dir and running from there or fully quantifying the executable java binary file when you run (JDK..../bin/java.exe on windows for example). 这可能意味着要么进入JDK / bin目录并从那里运行,要么在运行时完全量化可执行的Java二进制文件(例如Windows上的JDK .... / bin / java.exe)。

As pointed out by Makoto, you need to use a -D option. 如诚诚所指出,您需要使用-D选项。 Note: no space between variable name and assigned value, ie -Dx=v is OK, whereas -Dx = v is wrong. 注意:变量名和赋值之间没有空格,即-Dx=v是可以的,而-Dx = v是错误的。 So: 所以:

java -jar evosuite-0.1.1.jar -Dtools_jar_location="C:\\Program Files\\Java\\jdk1.7.0_75\\lib"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM