Build An openoffice development environment in Ubuntu

Source: Internet
Author: User
Recently, I used the openoffice (oo) sdk to open an oo client. In fact, the main purpose is to use oosdk programming to read documents in various formats, including those of MS and oo, input from the file and from the clipboard. Openoffice Development Guide, the official Developers_Guide for oo, which is very comprehensive. The only drawback is that it is too long. It can be viewed as a manual. You can quickly learn how to use the sdk by analyzing the examples in the sdk. This article mainly refers to the use of the openoffice (later referred to as oo) sdk to open the oo client. In fact, the main purpose is to use the oo sdk programming to read documents in various formats, including MS, oo, input from the file, and input from the clipboard.
Openoffice Development Guide, the official Developers_Guide for oo, which is very comprehensive. The only drawback is that it is too long. It can be viewed as a manual. You can quickly learn how to use the sdk by analyzing the examples in the sdk. This article mainly refers to Chapter 1 in Developer's Guide and the help manual after sdk installation.
Ubuntu 8.04 is used to build an oo development environment.

1. install necessary software
    • Jdk, jre
      • Sudo apt-Get install sun-Java 6-Jre sun-Java 6-Jdk
    • Openoffice
      • Generally, Ubuntu is installed by default.
    • Openoffice-java-common
      • This is very important. The oo installed in Ubuntu does not include the java Development library, so you need to manually install it. Otherwise, the system prompts that the class cannot be found during compilation.
      • Sudo apt-Get install openoffice.org-Java-Common
    • Make, g ++, gcc, zip
      • These commands are generally installed. If not, you can use apt-get to install them.
      2. Install the sdk
      1. Download sdk
        1. Because the latest stable version of oo is 2.4, So we download sdk 2.4, according to your own operating system, choose a different version, here I download is OOo-SDK_2.4.0_LinuxIntel_install.sh
      2. Run the shell file in the Ubuntu command line and get an openoffice.org-sdk-2.4.0-9286.i586.rpm file in the/var/tmp/unpack_openofficeorg/RPMS directory. Use the alien command to convert the rpm file to the deb file, and then install the deb file. If you are prompted that the permission is insufficient, modify the File Permission.
        1. Sudo alien openoffice.org-sdk-2.4.0-9286.i586.rpm
        2. Sudo dpkg-I openoffice.org-sdk-2.4.0-9286.i586.deb
      3. Set Environment Variables
        1. The sdk installation address is/opt/openoffice. org2.4 _ sdk. Enter this directory.
        2. Run./setsdkenv_unix
        3. Enter the relevant parameters, including officehome,/usr/lib/openoffice, and/usr/lib/jvm/java-6-sun in the java jdk directory.
        4. After completion ~ /Usrname/openoffice. org2.4 _ the environment generated in the sdk changes the setting script. Run the source ~ /Openoffice. org2.4 _ sdk/setsdkenv_unix.sh.
      4. After the installation is complete, read the content in/opt/openoffice. org2.4 _ sdk/index.html carefully.
      3. Example of running the sdk
      1. Open the terminal and set the environment to change source ~ /Openoffice. org2.4 _ sdk/setsdkenv_unix.sh
      2. Go to the sdk's example directory, cd/opt/openoffice. org2.4 _ sdk/example/java/directory. There are many examples in this directory. For example, we enter the Text directory.
      3. To the Text directory, run the make command to automatically compile all programs. The storage address of the Target Program is also displayed.
      4. As prompted, run the make ***. run Command to start the corresponding example program. Alternatively, run java-jar *****. jar in the input directory.
      5. By reading the exmaple code, you can quickly learn how to use the oo api. The api documentation is in/opt/openoffice. org2.4 _ sdk/docs, where
        1. Common is a common document. Most of the usage methods can be found here.
        2. Java is a java-specific api
      4. Install netbeans for openoffice development ide

      Refer to using netbeans to develop openoffice programs and use openoffice plug-ins provided by netbeans.
      Note that
      1. When configuring the path, the openoffice path is/usr/lib/openoffice, And the openoffice sdk path is/opt/openoffice. org2.4 _ sdk
      2. After the project is created and run, the system prompts "no executable openoffice". The solution is to add/usr/lib/openoffice/program to the project library.
      You can also use eclipse, but I have never succeeded. Refer to here and here.

      5. Existing Problems
      1. For programs compiled by oo, an oo that can be run can be executed. This oo can be local or remote. Is equivalent to a server. So how can we add a completed oo to the software release? It may be noted that this software depends on a completed oo, so please install it in advance?
      2. The oo program developed in netbeans cannot run normally after it is packaged as a jar file. There are two solutions:
        1. Compile the script/opt/settings/std. mk file. Some files are added to the packaged jar, including win/unowinreg. dll,/com/sun/star/lib/loader. These classes are estimated to be oo programs. You only need to add these files to the jar file to run normally.
        2. Refer to this page and use a library to connect to oo
      6. Useful Web pages
      1. Save a file
      2. File Save/conversion operations
      3. Operation of pasting
      4. Use the open office entry-level instance Program

      Contact Us

      The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

      If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

      A Free Trial That Lets You Build Big!

      Start building with 50+ products and up to 12 months usage for Elastic Compute Service

      • Sales Support

        1 on 1 presale consultation

      • After-Sales Support

        24/7 Technical Support 6 Free Tickets per Quarter Faster Response

      • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.