使用另一个 java 项目中的 Java Path Finder
我想使用另一个 java 项目中的 JPF(Java Path Finder)。
我已完成的步骤:
我创建了一个新的 Java 项目
在构建路径中引用了 jpf-core。
创建了一个java类(Test.java)打印Hello world(在我的新项目中)。
创建了一个 .jpf 文件(Test.jpf),我已经提到过,target=Test。
在我提到的 eclipse 启动配置中
项目 = jpf-core 主类 = gov.nasa.jpf.tool.RunJPF
我的问题是,如果我将相同的 .java 文件和 .jpf 文件放在 jpf-core 项目的 jpf-core/examples 包中,我就能够运行 jpf 文件并获得结果。但是当我尝试从另一个 java 项目运行 .jpf 时,我无法这样做。我收到以下错误
[SEVERE] can't find startup class: Test`
[SEVERE] error initializing startup classes (check 'classpath')
请帮助我解决此问题。
更新:
我是否必须编写任何提及我的测试类文件的类路径的属性文件?如果我这样写,如何将它们与 jpf.properties 链接起来?
I want to use JPF (Java Path Finder) from another java project.
Steps that i have done:
I have created a new Java project
Referenced the jpf-core in build path.
Created a java class(Test.java) printing Hello world (in my new project).
Created a .jpf file (Test.jpf) in that i have mentioned, target=Test.
In the eclipse launch configuration i have mentioned
project = jpf-core Main Class = gov.nasa.jpf.tool.RunJPF
My problem is If i place the same .java file and .jpf file in jpf-core/examples package in jpf-core project i am able to run the jpf file and get the results. But when i am trying to run the .jpf from another java project i am unable to do so. I am getting the following error
[SEVERE] can't find startup class: Test`
[SEVERE] error initializing startup classes (check 'classpath')
Please help me to resolve this.
Update:
Do i have to write any properties file mentioning the classpath of my Test class files? If i write so how do i link up them with jpf.properties?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我希望这还不算太晚。
我正在使用 JPF 的 Eclipse 插件。
从另一个 java 项目运行 JPF。我需要创建一个 jpf.properties 文件来设置配置。使用eclipse插件,可以在创建JPF项目时自动生成。在 jpf.properties 文件内,需要将 .classpath 和 .sourcepath 配置设置为您的测试文件(始终来自 build\XXX,因为 JPF 正在加载 java 字节码)。
然后右键单击 .jpf 文件并单击“验证”(eclipse 插件)。在此之前,我需要告诉 Eclipse jpf-core 目录。只需创建一个 site.properties 文件并写入“jpf-core = your JPFdirectory”即可完成。谢谢。
根据 JPF 权威机构的建议,JPF 通过插件支持变得更简单、更快捷。
I hope this is not too late.
I am using Eclipse Plugin for JPF.
To run the JPF from another java project. I need to create a jpf.properties file to setup the config. With eclipse plugin and it can be auto-generated when creating a JPF project. Inside the jpf.properties file, the .classpath and .sourcepath config need to be set to your testing file (always from build\XXX as JPF is loading java bytecode).
Then right click on the .jpf file and click "Verify" (eclipse plugin). Before hand, I need to tell the eclipse about the jpf-core directory. Just create a site.properties file and write "jpf-core = your JPFdirectory" will be done. Thank you.
As advised by the JPF authority, JPF is easier and faster with plug-in support.
您的其他项目需要引用包含 Test 类的项目。否则它显然不在类路径上。检查“构建路径”下的“项目”选项卡。
Your other project needs to reference the project that contains the Test class. Otherwise it is obviously not on the classpath. Check the Project tab under Build-Path.