Rajesh Kumar
Rajesh Kumar

Reputation: 355

Error: Could not find or load main class net.sourceforge.cobertura.merge.Main

I am getting this strange error while excuting following commands..

 cobertura-merge.bat --auxClasspath ./cobertura-2.0.3.jar --datafile cobertura.ser cobertura1.ser cobertura2.ser

 cobertura-merge.bat --auxClasspath . --datafile cobertura.ser cobertura1.ser cobertura2.ser

Error - Error: Could not find or load main class net.sourceforge.cobertura.merge.Main

PS -

  1. I have JAVE HOME set.
  2. Java bin dir is added to PATH.
  3. CLASSPATH is defined with - %CLASSPATH%;.;.
  4. I have added cobertura-2.0.3.jar in jdk lib and jre lib directory.

Upvotes: 1

Views: 1078

Answers (1)

dave823
dave823

Reputation: 1211

I ran in to the same problem. To fix this, you will need to edit the cobertura-merge.bat in a text editor. The last line looks something like this:

java -cp "%COBERTURA_HOME%cobertura.jar;%COBERTURA_HOME%lib\asm-3.3.1.jar;.....

The jar file names in this command most likely do not match the jar file names in your cobertura_home\lib.

Example: In the command above, from the batch file, it references 'cobertura.jar' If you look in the lib folder, the actual name of the file is 'cobertura-2.0.3.jar

The same goes for the other jar files. So you will have to change the bat file, or the file names, to make them match.

Upvotes: 0

Related Questions