0

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 Answers2

0

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

mernst
  • 7,437
  • 30
  • 45
  • I tried but it didn't worked. Aftert many attemps I was able to generare tests by mean of this command: java -classpath Randoop/randoop-all-4.3.2.jar:target/myJar.jar randoop.main.Main gentests --testjar=myJar.jar. So, what I did is to add /myJar.jar after target in myclassPath – Saverio Mirko Viola May 17 '23 at 07:58
0

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.