[Solved] Minimum needed to compile a Java extension for OOo?

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
jpatokal
Posts: 6
Joined: Fri Mar 26, 2010 6:03 am

[Solved] Minimum needed to compile a Java extension for OOo?

Post by jpatokal »

I need to make a few small changes to Sun Wiki Publisher and have been trying to set up the Java compilation environment for it, but am having major trouble figuring out exactly what I need to make this happen. So far, I've extracted the source code from CVS...

Code: Select all

cvs -d :pserver:anoncvs@anoncvs.services.openoffice.org:/cvs checkout sw/swext
But sw/swext/mediawiki/makefile.mk has tons of dependencies to an undefined environment:

Code: Select all

.IF "$(ENABLE_MEDIAWIKI)" == "YES"
.INCLUDE : ant.mk
.IF "$(SYSTEM_APACHE_COMMONS)" != "YES"
COMMONS_CODEC_JAR=$(SOLARVER)$/$(INPATH)$/bin$(UPDMINOREXT)$/commons-codec-1.3.jar 
  ...
And the makefile.pmk a level up in sw/swext isn't any more useful:

Code: Select all

XSLDIR=$(SOLARXMLDIR)$/processing
XCSROOT=$(SOLARXMLDIR)
ABSXCSROOT=$(SOLARXMLDIR)
DTDDIR=$(SOLARXMLDIR)
PROCESSOUT=$(MISC)$/$(CUSTID)
PROCESSORDIR=$(SOLARBINDIR)
If I'm understanding the Building Guide correctly, I need to grab the entire >800 MB Mercurial distro, run ./configure, then use ./bootstrap to create customized copy of dmake for my system. Will this then supply all the missing variable names above, or do I need to set up something else as well? Given that I already have OO and all its jars installed on my system, is there really no simpler way of making this happen? :ucrazy:
Last edited by Hagar Delest on Wed Mar 31, 2010 4:17 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.1 on Ubuntu 9.10
jsc
Posts: 2
Joined: Thu Dec 06, 2007 6:37 am
Location: Germany

Re: Minimum needed to compile a Java extension for OOo?

Post by jsc »

yes, for this extensions you have to configure a working build env. Normally it is sufficient to have an SDK and OOo to compile Java extensions. But it depends on the used project structure. The SDK also provides a minimal build env for the SDK examples that can be adapted. In case of Java the easiest way is to use NetBeans and our OOo API plugin ....
AOO 3.4.1 is available!
jpatokal
Posts: 6
Joined: Fri Mar 26, 2010 6:03 am

Re: Minimum needed to compile a Java extension for OOo?

Post by jpatokal »

Well, that was painful :crazy: , but now it's finally compiling. Steps for future reference:

1) Download the source dump as described in Getting the source.

2) Get ./configure to run. I ended up using this command line:

Code: Select all

./configure --with-use-shell=bash --with-system-libs --without-system-jars --without-system-icu --without-system-agg --without-system-lpsolve --without-system-mspack --disable-mozilla --disable-odk
And installed approx. 17 gazillion dependencies. (A few of the trickier ones are listed here.)

3) Edit LinuxX86-64Env.Set.sh to set BUILD_DMAKE=yes, ENABLE_MEDIAWIKI=yes

4) source LinuxX86-64Env.Set.sh

5) ./bootstrap to compile dmake -- should run a bunch of C compilation stuff and spit out a dmake into your path. (This would also be a good time to run sudo apt-get purge dmake if you make the mistake of attempting to use the Ubuntu builtin dmake earlier...)

6) Run dmake 2>&1 >error.log, check the top of error.log and figure out where it's reading jars from:

Code: Select all

... -Dsolar.jar=/home/janip/oo/solver/300/unxlngx6.pro/bin ...
7) Drop in the jars we need in this directory:

Code: Select all

cp /usr/share/java/openoffice/* /home/janip/oo/solver/300/unxlngx6.pro/bin/
cp /home/janip/.openoffice.org/3/user/uno_packages/cache/uno_packages/vplv2e_/sun-wiki-publisher.oxt/commons-* /home/janip/oo/solver/300/unxlngx6.pro/bin/
First line is the standard OO jars, second set is the Apache Commons jars used by the Sun MediaWiki extension.

8) Compile! :bravo: And ignore the final "BUILD FAILED" about "registry/data not found", all you need is the mediawiki.jar.
OpenOffice 3.1 on Ubuntu 9.10
jpatokal
Posts: 6
Joined: Fri Mar 26, 2010 6:03 am

Re: Minimum needed to compile a Java extension for OOo?

Post by jpatokal »

One more grumble: the CVS repository in my first post, and the link pointing to it from the Sun Wiki Extension official page, are totally out of date. You need to use the updated version in the Mercurial repository (contained in the tarball at swext/mediawiki) to get it to play nice with OO...
OpenOffice 3.1 on Ubuntu 9.10
Post Reply