How to configure plug-ins in eclipse

Source: Internet
Author: User

Eclipse can rival any IDE, or even better than it. Eclipse hasCodeComplement, code template functions, and support for refactoring, ant, CVS, and JUnit. In addition to these basic functions, one of the advantages of eclipse is itsSource codeIt is open and highly scalable. Many plug-ins can be expanded. Both open-source plug-ins and commercial plug-ins can be used to expand eclipse. If you need features that are not available in the basic Eclipse IDE, You can generally find the required plug-ins. In most cases, you can find a free plug-in.

Due to the popularity and open-source features of Eclipse, it has become a cutting edge in the IDE field. On the one hand, eclipse is improving its functions step by step, and on the other hand, eclipse is scrambling to seize the application fields developed by IDE. Data shows that eclipse is one of the most popular Java development environments. To better use eclipse for development, it is necessary to understand the Eclipse plug-in mechanism and how to install and use the plug-in.

Eclipse plug-in

Eclipse is a fully designed platform and a development tool for building and integrating applications. The platform itself does not provide a large number of end-user functions. The value of the platform is its promotion function: rapid development and integration of functional components based on the plug-in model. The platform itself is built in the plug-in layer. Each plug-in defines extensions of the lower-layer plug-ins, and further customizes its own extensions. Each type of extension allows plug-in developers to add various features to the basic tool platform. The components of each plug-in (such as files and other data) are coordinated by public platform resources. The most attractive part of eclipse is its plug-in architecture. With plug-ins, the core part of eclipse is very simple at startup: start the basic part of the platform and find the system plug-in.

The core of eclipse is dynamic discovery, lazy loading, and running. The platform user interface provides a standard user navigation model. As a result, each plug-in can focus on executing a small number of tasks, such as definition, testing, animation production, publishing, compilation, debugging, and diagrams, as long as the user can imagine everything.

When the Eclipse plug-in implements an extension point, an extension is created. In addition, the plug-in using this extension point can also create its own extension point. The extension points of this plug-in mode are recursive and proved to be flexible. In fact, the core of eclipse is built on the plug-in. With the accumulation of Eclipse plug-ins, this plug-in mode becomes increasingly mature.

Plug-in Installation Considerations

Beginners may fear the plug-in and think it is the underlying thing of Eclipse. In fact, it is very easy to install the plug-in. When installing the plug-in, pay attention to the following issues.

1.Plug-in dependency

If the plug-in you want to install requires support from other plug-ins, you need to install the dependent plug-ins to make the newly installed plug-ins run normally. For example, if you want to install a graphical editing plug-in, but this plug-in requires the support of the graphic editing framework (GEF) plug-in, you must first install GEF to make the new plug-in installed successfully.

2. Cache

Eclipse MEETINGLoad the plug-in through the cache mechanism, Sometimes the plug-in you just installed may not be started properly (especially in links mode), clear the cache and restart eclipse.The easiest way to clear the cache is to delete all folders in the configuration directory of Eclipse.(Keep the config. ini file), You can also useStartup parameter-Clean start.

Note:Plug-ins installed in update modeYou cannot delete the directory installed in update mode. Otherwise, the plug-in installed in this mode cannot be started.

3. Version

When you install a plug-in that requires a specific version of eclipse or depends on a specific version of the plug-in, it may also cause the plug-in installation to fail.

The installation plug-in must correspond to the dependent plug-in version and the dependent eclipse version. For example, the image editing plug-in to be installed depends on the GEF plug-in, and the version is 3.2, GEF 3.2 can only run in eclipse3.2 and later versions. Therefore, this graphic editing plug-in can be correctly installed only when GEF 3.2 and eclipse3.2 are installed.

Before installing the plug-in, you need to check the plug-in list on which the plug-in depends and the help documentation for specific version information. When a plug-in is released, a list of plug-in dependencies is released. With this information, you can correctly install the plug-in.

 

Plugin installation

Eclipse is installed through a very "clean" installation method. It does not affect the running of other software because of eclipse installation. The same is true for installing Eclipse plug-ins.

Plugin installation methods include:Copy installation, links installation, and update InstallationThey have their own characteristics. The following describes the installation methods respectively:

Copy and install

Copy installation is the simplest method for installing plug-ins. You only need to extract the compressed file of the plug-in and copy it to the eclipse installation directory. For example, “gef-all-3.1.zip is the compressed package of the GEF plug-in, which contains the eclipse directory, and the eclipse directory contains the Plugins directory and features directory, as shown in 1.

 

Figure 1 Structure of the GEF plug-in compressed package

After decompression, copy the Plugins directory and features directory to the eclipse installation root directory. After copying to the eclipse root directory, the installation is complete. If you want to install the plug-in correctly, and the third-party plug-in and eclipse versions on which the plug-in depends are correct, restart eclipse to see the running effect of the newly installed plug-in.

Links Installation

Using links to install plug-ins is a "clean" and effective installation method, which is also recommended by the author. Imagine how many plug-ins can be deleted if there are too many plug-ins installed in the same eclipse by copying the installation method? You have to find all the plug-ins in the eclipse plugins directory and delete them one by one. In addition, you have to delete all the related installation options under the feature. how painful this is.

The links installation method relieves you from this annoyance. By using the links installation method, you do not need to copy all the plug-ins to the eclipse directory. You only need to write a text file, by specifying the plug-in location through the file, let eclipse find the plug-in directory. To delete a plug-in, you only need to delete the plug-in referenced in a text file or text file. Follow these steps to install the plug-in through links:

1. Create a links directory under the eclipse directory (eclipse_home.

2. Create a link file in the eclipse_home % \ links directory (as long as it is a text file ).

3. point the link file to the directory where the plug-in is located, for example, the file content is "Path = D:/Program/Java/Eclipse/Plugin-download/GEF-ALL-3.1 ", the path separator is "/" or "\". A file can point to several plug-ins, that is, write several more lines in the same file "Path = ..." You can. You can also write several more link files under the links directory. The author installs the plug-in by writing each plug-in to a file. This allows you to intuitively delete the file when deleting the plug-in, as shown in figure 2.

 

Figure 2 install plug-ins using links

4. the directory structure of the plug-in is the same as the directory structure of the plug-in eclipse, for example, the structure of the GEF plug-in after decompression is "GEF-ALL-3.1/Eclipse /...", The link file points to the GEF-ALL-3.1 directory. After eclipse is started, all the plug-ins in the eclipse subdirectory under the GEF-ALL-3.1 directory will be found. The following is the content of a link file:

 
Path = D:/myplugin/tptp
 
Path = D:/myplugin/WTP
 
Path = ../Birt

Path can be the absolute path of the plug-in, but also the relative path relative to the eclipse installation directory, such as "Path = ../Birt ". If you want to delete a plug-in, you can delete the link file or the reference in the file, or delete the row of the plug-in path in the Link file, that is, you can delete the plug-in reference.

Tip:After deleting the link file or the links directory, restarting eclipse may fail. Clear the cache of Eclipse..

Update Installation

In addition to the copy installation method and the links installation method, eclipse can also install plug-ins through the network. This method is simple. You only need to know the update address of the plug-in. By parsing the XML file of the update address, eclipse knows where to find the plug-in update package. In addition, eclipse can determine whether the current installed plug-in version is correct.

Installing the plug-in through update is very simple. The specific steps are as follows.

1. Select "help"> "Software Updates"> "find and install". The Dialog Box 3 is displayed.

 

Figure 3 search for a new update site

2. Select the second item and click "Next" to open the "Update site" dialog box, as shown in figure 4.

 

Figure 4 Update site

3. Click "new remote site" in the displayed site dialog box to open the dialog box for the specified Update site, as shown in Figure 5.

 

Figure 5 Add a new update site

4. After adding a new site, follow the eclipse Update Wizard to complete plug-in installation.

Tip: many developers prefer to install the plug-in through update. This method is simple, and the eclipse wizard is responsible for checking whether the dependency plug-in of the current plug-in exists to ensure that the plug-in is successfully installed.

View plug-ins

After installing the plug-in, if you want to confirm whether the plug-in is successfully installed, You can restart eclipse and check whether the plug-in is loaded. The steps are as follows.

1. Select "help"> "about eclipse SDK", as shown in dialog box 6.

 

Figure 6 about dialog box

2. Click the "plug-in details" button. If the plug-in is successfully installed, it will be displayed in the plug-in dialog box (all successfully installed plug-ins will be displayed in this dialog box), as shown in 7.

 

Figure 7 plug-in List dialog box

If the installation fails, check whether the installation steps are correct by referring to the method described above, or clear the cache of eclipse and restart it.

Usually, the installation of eclipse is described above, but some commercial plug-ins may installProgramInstall plug-ins (such as myeclipse) in the same way.

 

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.