1

I want to use JPF (Java Path Finder) from another java project.

Steps that i have done:

  1. I have created a new Java project

  2. Referenced the jpf-core in build path.

  3. Created a java class(Test.java) printing Hello world (in my new project).

  4. Created a .jpf file (Test.jpf) in that i have mentioned, target=Test.

  5. 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?

Community
  • 1
  • 1
  • So, I still don't get it. Can you clarify your question and show your project layout? The folders and the command you use to start it? (to be honest, I don't understand why so many people have problems with classpathes ... :-/ ) – Angel O'Sphere Aug 23 '11 at 09:16
  • @Angel O'Sphere: Sure, If you have used Java Path Finder, you might have known about jpf-core. jpf-core is the main library/jar that is used to run JPF applications. My Project (Name: TestProject) contains two files 1.) Test.java, this is the SUT (system under test). 2.) Test.jpf file, which is used by jpf-core to run my SUT. I have also referenced jpf-core in my buildpath. But i am getting the error as mentioned in my question. – Kishore DVS Aug 24 '11 at 05:27
  • You have to reverse the dependency of the projects. – Angel O'Sphere Aug 24 '11 at 15:40
  • Very first question for your answer. Have you worked on JPF? If so you should know, it is very basic thing that your project should refer to the jpf-core. – Kishore DVS Aug 25 '11 at 13:52
  • oki .... forget it then. HOW should the JPF find the Java file if you don't want to tell it where it is? – Angel O'Sphere Aug 25 '11 at 14:41

2 Answers2

2

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.

bLaXjack
  • 780
  • 2
  • 11
  • 23
0

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.

Angel O'Sphere
  • 2,642
  • 20
  • 18
  • I think you got me wrong, My project contains Test class and .jpf file, and i am referring to jpf-core project. Now when i execute the .jpf file. I am getting the error as mentioned in my question – Kishore DVS Aug 22 '11 at 14:49