Implement Hello world in an equinox environment in eclipse

Source: Internet
Author: User
1. Download and install eclipse

Http://www.eclipse.org/downloads

The eclipse version is v3.3.1.

2. Create a new project 1. Select
File > New > Other...

2. Select plug-in development> plug-in project and next

3. Enter a project name and next

4. Set the package name of the activator file. If the package does not exist, eclipse will create it. Next

5. Select a template. You do not need to select any template. Finish

6. Project Structure

3. write code

1. Edit the activator. Java File

Delete unnecessary code. All content of the file is as follows:

package cn.org.tuscany;
import org.osgi.framework.*;

public class Activator implements BundleActivator {
  public void start(BundleContext context) {
    System.out.println("Hello World!");
  }
 
  public void stop(BundleContext context) {
    System.out.println("Goodbye World!");
  }
}
2. Edit the manifest. MF File

The content is as follows:

Manifest-version: 1.0
Bundle-manifestversion: 2
Bundle-Name: osgi_equinox_helloworld plug-in
Bundle-symbolicname: osgi_equinox_helloworld
Bundle-version: 1.0.0
Bundle-Activator: cn.org. Tuscany. Activator
Import-package: org. osgi. Framework
(Note: there must be an empty line without any spaces)

 

Iv. Run
  • 1. In the project list on the left, right-click the project and choose run as> osgi frameword from the context menu...

  • 2. console display

Now, equinox Hello world in eclipse environment is complete.

This is a basic operation process for developing equinox bundle using eclipse.

Related Article

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.