Randoop --testjar No Such file or directory

79 views Asked by At

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

There are 2 answers

0
Saverio Mirko Viola On 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.

1
mernst On

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