Java Development on the Eclipse Platform

Source: Internet
Author: User

This article provides an overview of the Eclipse platform, including its source and architecture. This article first briefly discusses the open-source nature of Eclipse and its support for multiple programming languages, and then demonstrates the Java development environment through a simple program example. This article also examines some software development tools available in the form of plug-in extensions, and shows a plug-in extension for UML modeling.
  
  What is Eclipse?
  
Eclipse is an open-source and Java-based scalable development platform. In itself, it is only a framework and a set of services, used to build a development environment through plug-in components. Fortunately, Eclipse comes with a standard plug-in set, including Java Development Tools (JDT ).
  
Although most users are happy to use Eclipse as a Java IDE, the goal of Eclipse is not limited to this. Eclipse also includes the Plug-in Development Environment (Plug-in Development Environment, PDE). This component is mainly used by software developers who want to expand Eclipse, because it allows them to build tools that are seamlessly integrated with the Eclipse environment. Because everything in Eclipse is a plug-in, for Eclipse to provide plug-ins, and to provide users with a consistent and unified integrated development environment, all Tool developers have the same place to play.
  
This equality and consistency is not limited to Java development tools. Although Eclipse is developed in Java, its usage is not limited to Java. For example, plug-ins supporting programming languages such as C/C ++, COBOL, and Eiffel are available, or is expected to be released. The Eclipse framework can also be used as the basis for other application types unrelated to software development, such as the content management system.
  
An outstanding example of Eclipse-based applications is IBM's WebSphere Studio Workbench, which forms the basis of the IBM Java development tool series. For example, WebSphere Studio Application Developer adds support for JSP, servlet, EJB, XML, Web Services, and database access.
  
  Eclipse is open-source software.
  
Open-source software is such a software that carries a license designed to ensure that certain rights are granted to users upon release. Of course, the most obvious right is that the source code must be available so that users can freely modify and re-distribute the software. This kind of user rights protection is implemented through a strategy called copyleft: software licenses claim copyright protection, and users shall not distribute the software unless such rights are explicitly granted to users. Copyleft also requires the same license to cover any software that is redistributed. This actually reverses the purpose of copyright-using copyright to grant user rights, rather than retaining copyright for software developers-copyleft is often described as "retaining all copyrights ".
  
Many fears, worries, and doubts about open-source software have spread everywhere, are related to the so-called "virus" nature of some copyleft licenses-if you use open source software as part of your program, you will lose your intellectual property rights, this license will "infect" the proprietary part of your development. In other words, this license may require that all software packaged with open source software must be released under the same license. Although this may be true for the most famous copyleft license (that is, the GNU General Public License, for example, Linux is issued under this license, other licenses provided a good balance between commercialization and community considerations.
  
Open source code Initiative is a non-profit organization that clearly defines the meaning of Open source code and certification licenses that meet its standards. Eclipse is licensed under OSI-recognized General Public License (CPL) Version 1.0. CPL "aims to promote the commercial use of programs ......" (For a link to the full text of General Public License version 1.0, see references later in this article ).
  
Developers who create plug-ins for Eclipse or use Eclipse as the basis for software development applications need to publish any Eclipse code they use or modify under CPL, however, they are free to decide how to grant their own code licenses. The proprietary code packaged with the software from Eclipse does not need to be licensed as open source code, and the source code does not need to be provided to users.
  
Although most developers do not use Eclipse to develop plug-ins or create new Eclipse-based products, the open source code of Eclipse means that, it doesn't just make Eclipse available for free (although a license that is easy to commercialize means that the plug-in may have to spend money ). Open Source Code encourages innovation and inspires developers (even commercial developers) to contribute code to public open source code libraries. There are many reasons for this, but the most fundamental reason is that the more developers contribute to this project, the more valuable this project will become to everyone. As this project becomes more useful, more developers will use it and build a community around it, just like those around Apache and Linux.
  
  What is Eclipse?
  
Eclipse.org manages and guides Eclipse development in progress. After it is said that IBM spent $40 million to develop Eclipse and release it as an open-source project, the Eclipse.org Association absorbed many software tool providers, including Borland, Merant, Rational, RedHat, SuSE, TogetherSoft, and QNX. Other companies have joined since then, including Hewlett Packard, Fujitsu, and Sybase. These companies have assigned a representative to the Council to determine the direction and scope of the Eclipse project.
  
At the highest level, the Project Management Board (PMC) manages Eclipse projects. This project is divided into multiple sub-projects, each of which has a person in charge. Large sub-projects are divided into groups, and each group also has a person in charge. At present, most of these management roles are held by the people of Object Technology International (OTI), an IBM subsidiary that initially developed Eclipse, but as an open-source project, it welcomes anyone to participate. The responsibility of any specific department is obtained through the contribution of the Department to the project.
  
Now we have examined some theories, history, and management behind Eclipse. Let's examine this product.
  
  Eclipse workbench
  
When you open Eclipse for the first time, you first see the following welcome screen:
  
  

Figure 1. Eclipse workbench
    
The Eclipse workbench consists of several panes called views, such as the Navigator view in the upper left corner. A set of PANES is called a perspective ). The default perspective is the Resource perspective, which is a basic universal visual gallery for managing projects and viewing and editing files in projects.
The Navigator view allows you to create, select, and delete projects. The right pane of Navigator is the editor area. Depending on the document type selected in Navigator, an appropriate editor window will open here. If Eclipse does not register an appropriate editor for a specific document type (for example, the. doc file on Windows), Eclipse will try to open the document using an external editor.
  
The Outline View under Navigator displays the document Outline in the editor. The accuracy of this Outline depends on the editor and document type. For Java source files, this outline displays all declared classes, attributes, and methods.
  
The Tasks view collects information about the project you are operating on. This can be information generated by Eclipse, such as compilation errors, or Tasks you manually add.
  
Most of the other features of the workbench, such as menus and toolbar, should be similar to other familiar applications. A convenient feature is the shortcut Toolbar of different perspectives, which is displayed on the left side of the screen. These features vary significantly with context and history. Eclipse also comes with a robust help system, which includes the Eclipse workbench and the included plug-ins (such as Java development tools) User Guide. It is worthwhile to browse the help system at least once, so that you can see the available options and better understand the Eclipse workflow.
  
To continue this short Eclipse journey, we will create a project in Navigator. Right-click the Navigator view and choose New => Project. When the New Project dialog box appears, select Java on the left. Standard Eclipse only has one Java Project type, named "Java Project ". If the plug-in is installed to provide JSP and servlet support, we will see an additional option for Web applications. Select a Java Project, enter "Hello" when prompted, and then press Finish.
  
Next, we will check the Java perspective. Depending on your favorite screen management method, you can change the Perspective in the current Window by selecting Window => Open Perspective => Java, or by selecting Window => New Window, then select the new perspective to open a new window.
  
As you might expect, the Java perspective contains a set of views that are more suitable for Java development. One of them is the view in the upper left corner, which is a hierarchy that contains various Java packages, classes, jar and other files. This view is called Package Explorer. Note that the main menu has been expanded -- and two new menu items are displayed: Source and Refactor.
  
   Java Development Environment (JDE)
  
To test the Java development environment, we will create and run a "Hello, world" application. Use the Java perspective, right-click the "Hello" project, and choose New => Class, as shown in figure 2. In the subsequent dialog box, type "Hello" as the class name. In "Which method stubs wocould you like to create ?" Next, select the "public static void main (String [] args)" check box, and then press Finish.
  
   Figure 2. Create a class in the Java perspective
    
In this way, a. java file containing the Hello class and the empty main () method will be created in the editor area, as shown in

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.