javapathfinder / jpf-core

JPF is an extensible software analysis framework for Java bytecode. jpf-core is the basis for all JPF projects; you always need to install it. It contains the basic VM and model checking infrastructure, and can be used to check for concurrency defects like deadlocks, and unhandled exceptions like NullPointerExceptions and AssertionErrors.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Classpath issue while using JPF(Java Path Finder)

shishir047 opened this issue · comments

I started working on JPF. Till now I have cloned the JPF from github repository and build the project also added site.properties file in jpf-core folder. I created another project in IntellijIdea using Maven for my code that need to test using JPF. I the class directory I have added .jpf file with target and classpath. When I tried to run .jpf file on cmd I am getting error.

site.properties file

jpf-core = $C:\Users\shish\OneDrive\Desktop\jpf-core
extensions=${jpf-core}

Screenshot 2023-11-25 042514

HelloUniverse.jpf file content

target=HelloUniverse
classpath=C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example

Error I am getting while running .jpf on cmd

C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example>C:\Users\shish\OneDrive\Desktop\jpf-core\bin\jpf.bat HelloUniverse.jpf

C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example>REM

C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example>REM overly simplified batch file to start JPF from a command prompt

C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example>REM [WARNING] unknown classpath element:

C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example\C;UsersshishOneDriveDesktopProjectCIS6614

argetclassesorgexample [SEVERE] cannot load application class HelloUniverse C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example>

When I change the name as HelloWorld instead of HelloUniverse everywhere, it worked fine. Even after compiling again after rename I am gettinbg this above error. Please let me know what I have done wrong.

Also, JPF Configuration File (jpf.properties)

# JPF configuration for "jpf-core" component

# path elements can either be relative to the property file location, or
# use the JPF component name (e.g. "jpf-core") as a variable prefix
# (e.g. "jpf-core.sourcepath=${jpf-core}/src/examples").
# If a jpf.properties is to be used within NB, it has to use the variable prefix
# (prepending the project root is only done during JPF init)

# we use the ';' separator here because it is recognized by NetBeans (as opposed
# to ',')

# 'config_path' is set automatically by gov.nasa.jpf.Config during JPF init.
# If used from within an Ant build system, 'jpf-core' has to be set explicitly
# (ant does ${..} property expansion, but ignores property redefinition, so the
# following line will be ignored)

jpf-core = ${config_path}

jpf-core.native_classpath=\
  ${jpf-core}/build/jpf.jar;\
  ${jpf-core}/build/jpf-annotations.jar

jpf-core.classpath=\
  ${jpf-core}/build/jpf-classes.jar;\
  C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\target\classes\org\example;\
  ${jpf-core}/build/classes 

jpf-core.sourcepath=\
  C:\Users\shish\OneDrive\Desktop\ProjectCIS6614\src\main\java\org\example

jpf-core.test_classpath=\
  ${jpf-core}/build/asm-9.5.jar;\
  ${jpf-core}/build/tests

jpf-core.peer_packages = gov.nasa.jpf.vm,<model>,<default>

I never used Windows, but your classpath entry UsersshishOneDriveDesktopProjectCIS6614 looks suspicious. You probably forgot to escape the backslashes. Use \\ for each backslash in the classpath and see what the result is.
In any case, this is not a bug in JPF.