$Id: sdk2.html,v 1.4 2005/08/22 05:57:57 xxjack12xx Exp $
by OpenOffice.org porting team, NAKATA, Maho, and Jackson LowYou know what I mean :)
If you haven't installed gmake, please install it.# cd /usr/ports/devel/gmake ; make install clean
Ah, you don't like Java :)# cd /usr/ports/java/jdk14 ; make install clean
You can obtain SDK here. Please make sure you obtain the SDK for the operating system you are using or make it by yourself. Instructions for builing SDK are described in the How to build section on the main page.
% make /work/tmp % cd /work/tmp % tar zxf <somewhere>/OOo_1.9m107_FreeBSD54Intel_sdk.tar.gz % cd OpenOffice.org2.0_SDK/ % ./configure *** Configure your SDK environment *** Enter the Office Software Development Kit directory [/work/tmp/OpenOffice.org2. 0_SDK]: Enter the Office installation directory []: /usr/local/openoffice.org1.9m107/ Enter GNU make (3.79.1 or higher) tools directory [/usr/local/bin]: Enter zip (2.3 or higher) tool directory [/usr/local/bin]: C++ compilers where for example a language binding exist: - Solaris, Sun WorkShop 6 update 1 C++ 5.2 2000/09/11 or higher - Linux, GNU C++ compiler, gcc version 3.0.1 or higher Enter the the location of the C++ compiler (optional) [/usr/bin]: Enter the Java SDK (1.4.1_01 or higher) installation directory (optional) []: /usr /local/jdk1.4.2/ Default output directory is the SDK directory itself. Enter an existing directory if you prefer a different output directory (optional) []: Automatic deployment of UNO components (YES/NO) [YES]: ********************************************************************* * ... your SDK environment has been prepared. * For each time you want to use this configured SDK environment, you * have to run the "setsdkenv_unix" script file! * Alternatively can you source one of the scripts "setsdkenv_unix.sh" * or "setsdkenv_unix.csh" to get an environment without starting * a new shell. *********************************************************************
Just hit enter to accept the defaults, except for two points:
First,Enter the Openoffice installation directory []: /usr/local/openoffice.org1.9m107/You must enter (basically from packages or ports, the installation directory is /usr/local/openoffice.org1.9m107/ )
Second,Enter Java SDK (1.4.1_01 or higher) installation directory [/usr/local]: /usr/local/jdk1.4.2Same as above; please input `/usr/local/jdk1.4.2'.
After you have completed your SDK setup, you need to set environmental variables before it can used. Please type:% ./setsdkenv_unix Starting shell with SDK environment.You can now use OpenOffice.org SDK. Congratulations!
You might also be interested in the sample programs. Type ./setsdkenv_unix as described above to use them.% ./setsdkenv_unix Starting shell with SDK environment.Next change dir to examples/DevelopersGuide/FirstSteps/% cd examples/DevelopersGuide/FirstSteps/This directory contains some very basic sample programs. First, type gmake to prepare next steps.% gmake mkdir -p ../../../FREEBSDexample.out/class/FirstStepsExamples mkdir -p ../../../FREEBSDexample.out/class/FirstStepsExamples "/usr/local/jdk1.4.2//bin/javac" -classpath "/usr/local/openoffice.org1.9m107//program/classes/jurt.jar:/usr/local/openoffice.org1.9m107//program/classes/unoil.jar:/usr/local/openoffice.org1.9m107//program/classes/ridl.jar:/usr/local/openoffice.org1.9m107//program/classes/juh.jar:../../../FREEBSDexample.out/class/FirstStepsExamples" -d ../../../FREEBSDexample.out/class/FirstStepsExamples FirstUnoContact.java rm -f ../../../FREEBSDexample.out/class/FirstStepsExamples/FirstUnoContact.jar mkdir -p ../../../FREEBSDexample.out/class/FirstStepsExamples cd ../../../FREEBSDexample.out/class/FirstStepsExamples && "/usr/local/jdk1.4.2//bin/jar" cvfm FirstUnoContact.jar FirstUnoContact.mf FirstUnoContact.class .... .... -------------------------------------------------------------------------------- Please use one of the following commands to execute the examples! - gmake FirstConnection.run gmake FirstLoadComponent.run gmake HelloTextTableShape.run --------------------------------------------------------------------------------Type gmake FirstConnection.run instead of typing make FirstConnection.run, since name of GNU make is gmake for (usual) FreeBSD.% gmake FirstUnoContact.run "/usr/local/jdk1.4.2//bin/java" -Dcom.sun.star.lib.loader.unopath="/usr/local/openoffice.org1.9m107//program" -jar ../../../FREEBSDexample.out/class/FirstStepsExamples/FirstUnoContact.jar Connected to a running office ... remote ServiceManager is availableConnection is established and sample program worked! Congratulations!
Next example is FirstLoadComponent. This program opens a calc sheet and insert 21 to A1, A2 cell. Do sum of them and result is written in A3 cell.% gmake FirstLoadComponent.run "/usr/local/jdk1.4.2//bin/java" -Dcom.sun.star.lib.loader.unopath="/usr/local/openoffice.org1.9m107//program" -jar ../../../FREEBSDexample.out/class/FirstStepsExamples/FirstLoadComponent.jar Connected to a running office ... com.sun.star.sheet.XSpreadsheet Formula cell in column 0, row 2 contains =SUM(A1:A2)HelloTextTableShape is interesting. This automatically creates Writer, Calc, and Draw!% gmake HelloTextTableShape.run
please refer examples.html
We can invoke OOo to listen on a TCP/IP port. We don't need to set it up.
N/A