0

I'm using Randoop, the automatic test generator for Java.

However, when running Randoop from the commandline, I can't seem to figure out how to properly specify the classpath.

I read through this question: Java Classpath error-cannot find my class in detail but my setup seems a bit different.

I'm running on a Windows machine.

The overall project structure looks like this:

cse331/
    bin/
        hw5/
            GraphNode.class
    src/
        hw5/
            GraphNode.java
    randoop-2.1.4.jar

(There are some other files but the not important here, I think)

I tried calling:

java -ea -classpath randoop-2.1.4.jar:bin/* randoop.main.Main gentests --testclass=GraphNode --timelimit=20

But received the error:

Error: Could not find or load main class randoop.main.Main

I've tried several variations, loading in the .java file instead of the .class file for the classpath but no option has worked so far. If I don't specify the class path at the end of randoop-2.1.4, I get an error message saying the class GraphNode cannot be found.

The setup is just the first step and I can't seem to get on the right track.

Community
  • 1
  • 1
waylonion
  • 6,866
  • 8
  • 51
  • 92

2 Answers2

1

In the end, the solution was to remove the asterisk from bin/ and include the semi colon like Sumit suggested.

java -ea -classpath randoop-2.1.4.jar;bin/ randoop.main.Main gentests --testclass=GraphNode --timelimit=20
waylonion
  • 6,866
  • 8
  • 51
  • 92
0

Try this one: It will surely remove this error. java -cp cse331/bin;randoop-2.1.4.jar randoop.main.Main gentests --testclass=hw5.GraphNode --timelimit=100.

If your project is maven project, Try to include all dependencies. for downloading use this command: mvn dependency:copy-dependencies

Let me know if you have any other queries regarding randoop.