Build an openoffcie development environment in ubuntu

Source: Internet
Author: User
Article Title: Build an openoffcie development environment under ubuntu. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Recently, I used the openoffice (oo for short) sdk to open the oo client. In fact, the main purpose is to use the oo sdk to program and 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 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

Download sdk

Because the latest stable version of oo is 2.4, we download sdk 2.4. select a different version based on your operating system. Here I download OOOOo-SDK_2.4.0_LinuxIntel_install.sh

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.

Sudo alien openoffice.org-sdk-2.4.0-9286.i586.rpm
Sudo dpkg-I openoffice.org-sdk-2.4.0-9286.i586.deb

Set Environment Variables

The sdk installation address is/opt/openoffice. org2.4 _ sdk. Enter this directory.

Run./setsdkenv_unix

Enter the relevant parameters, including officehome,/usr/lib/openoffice, and/usr/lib/jvm/java-6-sun in the java jdk directory.

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.

After the installation is complete, read the content in/opt/openoffice. org2.4 _ sdk/index.html carefully.

3. Example of running the sdk

Open the terminal and set the environment to change source ~ /Openoffice. org2.4 _ sdk/setsdkenv_unix.sh

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.

To the Text directory, run the make command to automatically compile all programs. The storage address of the Target Program is also displayed.

As prompted, run the make ***. run Command to start the corresponding example program. Alternatively, run java-jar *****. jar in the input directory.

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

Common is a common document. Most of the usage methods can be found here.

Java is a java-specific api

4. Install netbeans for openoffice development ide

ReferencesUse netbeans to develop openoffice programsUse the openoffice plug-in provided by netbeans.

Note that

When configuring the path, the openoffice path is/usr/lib/openoffice, And the openoffice sdk path is/opt/openoffice. org2.4 _ sdk

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. ReferenceHereAnd java‑setuto ">Here.

5. Existing Problems

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?

The oo program developed in netbeans cannot run normally after it is packaged as a jar file. There are two solutions:

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.

Refer to this page, Use a library to connect to oo

6. Useful Web pages

Save a file 
File Save/conversion operationsOperation of pastingUse 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.