junit autogen error?

Stephan Bergmann sbergman at redhat.com
Tue Nov 19 00:11:49 PST 2013

On 11/16/2013 09:54 AM, Alexander Thurgood wrote:
> Le 15/11/13 13:48, Noel Grandin a écrit :
>> You need to do:
>> ./autogen.sh --with-junit=/opt/local/share/java/junit-4.jar
>> or whatever your jar file name is.
> Having tried this for a while the day before yesterday on OSX Mavericks,
> with the latest hamcrest or junit from the project's download page, I
> can confirm that I couldn't get this to work either.

There is two problems:

First, recent Junit as downloaded from 
<https://github.com/junit-team/junit/wiki/Download-and-Install> is split 
in two jars of which the junit-4.11.jar does not include the 
hamcrest-core-1.3.jar on its manifest Class-Path.

What worked for me is to run the attached Makefile and junit-manifest 
from some directory X and include --with-junit=X/junit.jar in LO's 

However, the second problem is that LO's configure.ac "manually" 
inspects the given junit.jar to check it contains the class files of 
both junit and hamcrest.  The attached configure.patch improves on that 
by instead using javah with -classpath junit.jar to check that the class 
files of both junit and hamcrest are available through the given 
junit.jar.  But that trick apparently does not work with all versions of 
javah, so I did not push that patch.  The best fix probably is to use 
javac with -classpath junit.jar for the check.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.patch
Type: text/x-patch
Size: 1445 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20131119/7ff690ff/attachment.bin>
-------------- next part --------------
Class-Path: junit-4.11.jar hamcrest-core-1.3.jar
-------------- next part --------------
junit.jar: hamcrest-core-1.3.jar junit-4.11.jar junit-manifest
	jar cmf junit-manifest junit.jar

	wget http://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar -O hamcrest-core-1.3.jar

	wget http://search.maven.org/remotecontent?filepath=junit/junit/4.11/junit-4.11.jar -O junit-4.11.jar

More information about the LibreOffice mailing list