skip to Main Content

I’m running the following command in Ubuntu, having an openJDK 17:

java -classpath Randoop/randoop-all-4.3.2.jar:./target randoop.main.Main gentests --testjar=myJar.jar

As you can see, I’m running the command with –testjar option but I get the following error:
Randoop for Java version 4.3.2.

Error while reading jar file myJar: myJar (No such file or directory).

The jar whose class I want to test is located and present in the target directory. So I do not understand what’s wrong…

I have also tried to run this command, without ./ before target class:

java -classpath Randoop/randoop-all-4.3.2.jar:target randoop.main.Main gentests --testjar=myJar.jar

I get the same error…

Anyone can help?
Thanks

2

Answers


  1. Chosen as BEST ANSWER

    I was able, after many attempts to solve the problem. I used this command:

    java -classpath Randoop/randoop-all-4.3.2.jar:./target/myJar.jar randoop.main.Main gentests --testjar=myJar.jar
    

    What I did is just add /myJar.jar after target in jar location on the classpath.


  2. --testjar=myJar.jar

    The jar whose class I want to test is located and present in the target directory.

    The --testjar command-line argument tells where to find the class. It doesn’t modify its argument, such as assuming it is in a particular directory. Can you try --testjar=target/myJar.jar?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search