Development of a system for automatic search for objects in the image. Installing the Eclipse Development Environment

Java is a high-level programming language that was developed by Sun Microsystems back in 1995. To date, the development of this technology is engaged in the company JCP (Java Community Process). One of the main features of the language is compilation, which is performed directly when the program is assembled.

The code is turned into bytecode and then executed in the Java virtual machine. The JVM acts as a translator that connects a programming language with the necessary components of a computer. This principle allows programs to work on any systems where a virtual machine is installed.

Features of the programming language

The object-oriented and typed Java language has many features that are useful to developers. Among them are the following:

  • Ease of learning. Basic knowledge of object-oriented programming will be enough for a comfortable mastering of the language.
  • Object-oriented methodology. Programs are made up of objects that can be easily extended and adapted to meet your goals.
  • Safety. Public key encryption provides the best authentication methods.
  • Platform independence. Programs written in the language are compiled into bytecode that can run on absolutely any platform of modern operating systems.
  • Portability. A programming language does not depend in any way on the implementation aspects of specifications.
  • Strength. The Java machine is able to cope with many errors due to the developer's focus and emphasis on constant checking and reducing compilation time.

In addition, this language is very common, as it is characterized as multi-threaded, high-performance, interpreted and dynamic.

Features of Java programming platforms

There are several implementations of this platform, among which Eclipse occupies a special place. The development environment for modular cross-platform applications has a number of mandatory features that are also present in other similar products. Among them are:

  • Common technologies for deploying programs in a user environment.
  • Tools for creating graphical interfaces of any complexity.
  • Libraries for remote control objects and programmatic access to data.
  • Tools for launching, debugging, compiling, monitoring and other actions with applications.

What is Eclipse?

Eclipse is a development environment currently controlled by the Eclipse Foundation. It provides open source code, which provides new opportunities for developers. It is written in Java and is intended to improve the process of creating software.

This project is an infrastructure that provides basic services that are important for developers. The available tools allow you to create new technologies in Eclipse. The development environment is not just a collection of APIs - it can handle full-fledged tasks.

A huge number of open source plugins source code gives unlimited possibilities for toolkit developers. Any additions can be added to the program, which ultimately will allow you to customize and adapt it to any task.

Platform Features

The programming environment has the following features:

  • A wide API assembly for adding new modules, as well as a framework for programming any extensions.
  • Support for all popular operating systems.
  • Programming in most known languages ​​allows exactly Eclipse - development environment. C Sharp (C#), Java, PHP, C, Python, C++ and many other languages ​​are supported by this program.
  • RCP technology is available, the capabilities of which will be enough to develop client software of any complexity and scale.
  • The modularity of the program provides incredible convenience and flexibility in work.

The Eclipse project continues to evolve in many directions. The program is constantly improving, expanding its functionality by adding new plugins.

Platform architecture

The programming environment consists of several basic elements. Firstly, this is the Eclipse Runtime, which is responsible for the operation of modules and plugins. This runtime includes basic functionality. This includes managing updates, interacting with the system, configuring plugins, maintaining the health of the help section.

Secondly, this is the IDE itself, responsible for managing projects, the leading elements of the program, as well as debugging, team development and searching among files.

Plugins such as PDE and Java Development Tools are also included with Eclipse. The development environment for Java programs and new add-ons becomes much more functional with the use of these plug-ins.

Examples of other specialized builds

The above Eclipse SDK is one of the platform versions. Several more builds of the IDE are available with unique features, namely:

  • For Java EE Developers. The version is intended for programming corporate or web applications using Java EE.
  • For JavaScript Web Developers. A build for building web products using CSS, XML, HTML, and JavaScript.
  • For Java Developers. Version for programming in Java.
  • For C/C++ Developers. Assembly for programming in C++ and C.

Each version has unique features, but the basic functionality for beginners is fully provided by the standard Eclipse (development environment). Lessons on it are available for free on the net, which will greatly simplify the study of the program.

Competing Products

This development environment has many competitors, but it is impossible to finally choose the best representative. Eclipse can be confidently considered the most popular. Almost all developers used it, thanks to a number of undeniable advantages.

When developing mobile applications Eclipse (development environment) is often used. The Android platform is rapidly evolving, and the IDE's Java language support is attracting developers. However, it is worth noting that its capabilities are much greater.

The main competitor of the program in question is the NetBeans product, and it is completely free. You will have to pay for the Eclipse license, and this scares some people away. Other competing products include IntelliJ IDEA, JDeveloper, Android Studio, DrJava, and MyEclipse. But many consider Eclipse to be the best. The development environment has been pleasing users for many years and does not stop doing it!

Eclipse is a free IDE for developing modular cross-platform applications. Developed and maintained by the Eclipse Foundation.

The most well-known applications based on the Eclipse Platform are the various "Eclipse IDEs" for developing software in multiple languages ​​(e.g. the most popular "Java IDE", which was supported natively, does not rely on any proprietary extensions, uses a standard public API to access the Eclipse Platform ).

Initially, Eclipse was developed by IBM as a successor to the IBM VisualAge development environment, as a corporate IDE standard for developing in different languages ​​for IBM platforms. According to IBM, the design and development cost $40 million. The source code was fully open sourced and made available after Eclipse was released to the IBM-independent community for further development.

In Eclipse 3.0 (2003), the OSGi service platform specifications were chosen as the runtime architecture. Since version 3.0, Eclipse has moved from being a monolithic IDE that supports extensions to being itself a set of extensions. It is based on the OSGi framework and SWT / JFace, on the basis of which the next layer is developed - RCP (Rich Client Platform, a platform for developing full-fledged client applications). RCP serves as the basis not only for Eclipse, but also for other RCP applications such as Azureus and File Arranger. The next layer is Eclipse itself, which is a set of RCP extensions - editors, panels, perspectives, a CVS module, and a Java Development Tools (JDT) module.

Since 2006, the Eclipse Foundation has been coordinating the annual Simultaneous Release, which takes place in June. Each release includes Eclipse platform, as well as a number of other Eclipse projects.

Benefits of Eclipse

Eclipse is primarily a platform for developing extensions, which is what made it popular: any developer can extend Eclipse with their own modules. There are already Java Development Tools (JDT), C/C++ Development Tools (CDT) developed by QNX engineers together with IBM, and tools for Ada languages ​​(GNATbench, Hibachi), COBOL, FORTRAN, PHP, etc. from various developers. Many extensions complement the Eclipse environment with managers for working with databases, application servers, and more.

Eclipse JDT (Java Development Tools) is the most famous module aimed at group development: the environment is integrated with CVS, GIT version control systems in the main distribution, there are plug-ins for other systems (for example, Subversion, MS SourceSafe). Also offers support for communication between the IDE and the task (error) management system. The main distribution includes support for the Bugzilla bug tracker, and there are also many extensions to support other trackers (Trac, Jira, etc.). Because it's free and of high quality, Eclipse is the corporate standard for application development in many organizations.

Eclipse is written in Java, so it is platform independent, with the exception of the SWT library, which is developed for all common platforms (see below). The SWT library is used instead of the standard Java Swing library. It relies entirely on the underlying platform (operating system) for a responsive and natural looking user interface, but sometimes causes compatibility and application stability issues across platforms.

The basis of Eclipse is the rich client platform (RCP). It consists of the following components:

OSGi (standard bundle delivery environment);

SWT (portable widget toolkit);

JFace (file buffers, text manipulation, text editors);

Eclipse working environment (panels, editors, projections, wizards).

The GUI in Eclipse is written using the SWT toolkit. The latter, unlike Swing (which emulates graphical controls on its own), uses the graphical components of a given operating system. The Eclipse user interface also depends on a GUI middleware called JFace that makes it easy to build a user interface based on SWT.

The flexibility of Eclipse is provided by plug-ins, which makes it possible to develop not only in Java, but also in other languages, such as C / C ++, Perl, Groovy, Ruby, Python, PHP, Erlang, Component Pascal, Zonnon and others.

Java platform

The Java Software Platform is a set of software products and specifications from Sun Microsystems, formerly an independent company and now a subsidiary of Oracle Corporation, that together provide a system for developing application software and embedding it in any cross-platform software. Java is used in a variety of computing platforms from embedded devices and mobile phones in the lower price segment, to corporate servers and supercomputers in the higher price segment. Although Java applets are rarely used on desktop computers, they are sometimes used to improve functionality and security when browsing the World Wide Web.

Program code written in Java is converted by the Java virtual machine into Java bytecode. However, there are bytecode compilers for other programming languages ​​such as Ada, JavaScript, Python, and Ruby. There are also several new programming languages ​​designed to work with the Java Virtual Machine. These are languages ​​such as Scala, Clojure and Groovy. Java's syntax is mostly borrowed from C and C++, but the object-oriented features are based on the model used in Smalltalk and Objective-C. Java lacks certain low-level constructs such as pointers, and Java has a very simple memory model where every object is located on the heap and all variables of an object type are references. Memory management is done through integrated automatic garbage collection, which is performed by the JVM.

- free framework to develop modular cross-platform applications.

The project was originally developed in IBM as a corporate IDE standard for development in different languages ​​for IBM platforms. Then the project was renamed to and provided for further development to the community.

First of all, complete Java IDE, aimed at group development, equipped with tools for working with version control systems (CVS support is included in the Eclipse distribution, several variants of SVN modules are actively developed, there is support for VSS and others). Because of the free Eclipse is the corporate standard for application development in many organizations.

Second appointment- serve as a platform for the development of new extensions (which has gained popularity - any developer can extend Eclipse with their modules). Those became C/C++ Development Tools(CDT), developed by QNX engineers together with IBM, COBOL, FORTRAN, PHP tools from various developers. Many extensions complement Eclipse with managers for working with databases, application servers, etc.

Since version 3.0, Eclipse is no longer a monolithic IDE that supports extensions, but a collection of extensions. It is based on the OSGi framework and SWT / JFace, on the basis of which the next layer was developed - a platform for developing full-fledged RCP client applications (Rich Client Platform - (English rich-client applications). The RCP platform serves as the basis for RCP applications such as Azareus and File Arranger The next layer is the Eclipse platform, which is a set of RCP extensions - editors, panels, perspectives, a CVS module, and a Java Development Tools (JDT) module.

Written in Java, therefore it is a platform-independent product, with the exception of the SWT library, which is developed for all common platforms. The SWT library is used instead of the "slow" Swing and is completely dependent on the underlying platform (operating system), which provides a fast and natural user interface.

The basis of Eclipse is the rich client platform (RCP). It consists of the following components:


  • OSGi (standard delivery environment for kits);
  • SWT (portable widget toolkit);
  • JFace (file buffers, text manipulation, );
  • Eclipse working environment (panels, editors, projections, wizards).
  • The GUI is written using the SWT toolkit. The latter, unlike Swing (which only emulates certain graphical elements of the platform used), actually uses the graphical components of this system. The Eclipse user interface also depends on a GUI middleware called JFace that makes it easy to build a user interface based on SWT.

    Flexibility is provided through plug-ins, which makes it possible to develop not only in Java, but also in other languages ​​such as C / C ++, Perl, Ruby, Python, PHP, ErLang and others.

    Localization

    From version 3.1.1, a language pack for Russification has been released. Both the graphical interface and the documentation have been translated into Russian.

    There are a number of free and commercial modules available for the environment. The environment was originally developed for the Java language, but there are now numerous extensions to support other languages, such as

    • C/C++ - CDT Eclipse's C/C++ Development Tooling
    • Perl - EPIC module, Eclipse Perl Integration
    • PHP - PDT PHP Development Tools
    • JavaScript - JSEclipse Javascript plugin for the Eclipse environment
    • Python - Pydev, Python Development Environment
    • Ruby - RDT, Ruby Development Tools

    There are also modules for creating graphical interfaces.

    For developing and receiving reports and developing analytical BI applications, there are en:BIRT_Projec t.

    The function of installing and updating modules via .

    Aptana(aptana.com) - distribution of Eclipse and a plugin that supports development using JavaScript (all major JS Ajax libraries are included in the distribution), HTML, CSS, Ruby on rails, Adobe AIR.

    Leave your comment!

    Using Eclipse plugins for editing, compiling, debugging, and as a base for your applications

    This addendum to David Gallardo's article offers new information regarding Eclipse V3.3.

    What is Eclipse?

    Eclipse is a Java-based open source extensible development platform. In fact, it is just a development environment and a set of services for building applications based on embedded components (plugins). Fortunately, Eclipse comes with a standard set of plug-ins, including the well-known Java Development Tools (JDT).

    While most users who use Eclipse as their Java Integrated Development Environment (IDE) are quite happy with it, it has much more to offer. Eclipse also includes a Plugin Development Environment (PDE), which will primarily be of interest to those who want to extend Eclipse itself, as it allows you to create your own tools that are built into the Eclipse environment. Since Eclipse is entirely plug-in, all toolkit developers have the opportunity to offer extensions to Eclipse and provide users with a consistent and seamless integrated development environment (IDE).

    This integrity and consistency is not unique to Java development tools. Although Eclipse is written in Java, it can be used with other languages ​​as well. For example, plugins already exist (or are being developed) that support such programming languages ​​as C/C++ and COBOL. The Eclipse framework can also be used as the basis for other types of applications not related to software development, such as content management systems.

    An excellent example of an Eclipse-based application is IBM® Rational® Software Architect (see ), which formed the basis of the IBM family of Java development tools.

    Eclipse is open source

    Open source software is released under a license intended to guarantee certain rights to users. The most obvious of these, of course, is that the source code must be provided to users, and they have every right to modify and redistribute the software themselves. This protection of user rights is achieved through a mechanism called "copyleft": The software license stands for copyright protection (copyright) and prohibits redistribution of the software unless the user is granted such rights. The copyleft license also requires that all software distributed by users be covered by the original license without modification. Thus, the meaning of copyright is essentially turned on its head, and a copyleft license, which uses copyright to give the user rights, and not to save them to the software developer, is often jokingly said "all rights are perverted" (all rights reversed).

    Much of the common fear, uncertainty, and doubt about open source software is based on the so-called viral nature of some copyleft licenses. The idea is that if you use open source software as part of your own development program, you will lose your intellectual property because the license will "contaminate" your private parts of the program. In other words, the license may require that all software incorporating open source software, including any newly created software, be distributed under the same license. While this is true of the most well-known copyleft license, the GNU General Public License (under which, for example, Linux® is distributed), there are other licenses that strike a different balance between commercial and public interests.

    The Open Software Initiative - OSI (Open Source Initiative) is a non-profit organization that clearly defines what constitutes open source and certifies licenses that meet its criteria. Eclipse is distributed under the EPL - Eclipse Public License (Open Eclipse License) V1.0, approved by OSI and aimed at facilitating commercial acceptance of Eclipse, while maintaining loyalty to the authors of the source code.

    Those who create plug-ins for Eclipse or use Eclipse as a base for software development are required to publish any Eclipse code they use or modify under the EPL license, but are free to license their own add-ons as they please. Native code bundled with software from Eclipse does not need to be licensed as open source, and the source code itself does not need to be made public.

    While most programmers won't use Eclipse to develop plug-ins or create new products based on it, the open source nature of Eclipse is important not only because it makes Eclipse available for free (and despite the fact that the commercially oriented the license implies that plugins can cost money). Open source promotes innovation and creates an incentive for developers (even commercial ones) to contribute their source code to the community. There are several reasons for this, but perhaps the most significant is that the more developers contribute to the project, the more significant it becomes for everyone. And when a project becomes useful, more and more developers will use it and build a community around it, similar to those that have formed around Apache and Linux. (For more information about licenses, see the section.)

    What is Eclipse?

    Eclipse is an open source developer community whose projects aim to build an open development platform consisting of extensible development environments, tools, and runtime libraries for building, deploying, and managing software during its life cycle. The Eclipse Foundation is a non-profit, member-supported association that hosts Eclipse projects and helps advance the open source community and ecosystem of complementary products and services.

    The Eclipse project was created in November 2001 by IBM and supported by a consortium of software vendors. The Eclipse Foundation was established in January 2004 as an independent, non-profit organization that serves as the steward of the Eclipse community. It was created to help a vendor independent, open and transparent community grow around Eclipse. Today's Eclipse community is made up of individuals and organizations representing the software industry.

    The Eclipse Foundation oversees and directs the ongoing development of Eclipse. The foundation serves the community, but open source developers called committers and, in fact, those who work on Eclipse projects are not on his staff. Typically, Eclipse committers are either in an organization or are independent developers who volunteer their time to work on an open source project.

    Now that we've looked at the theoretical, historical, and political aspects of Eclipse, let's take a look at the product itself.

    Eclipse workspace

    When you first start Eclipse, you will see a welcome page inside the workspace (see Figure 1). The Eclipse user has several options to navigate to the overview page, which is what I recommend doing (see Figure 2). Next, you can read information about new features, explore some examples, or take a tutorial.

    Figure 1. Eclipse welcome page
    Figure 2. Eclipse overview page

    The Eclipse workspace consists of several panels called representations, such as navigator or outline views. The set of such representations is called perspective. One of the most common perspectives is the Resources perspective, which is a basic set of views for managing projects and viewing and editing project files.

    I recommend that most novice users start at the overview page shown in Figure 2 and learn more about Eclipse. The workbench basics section contains a lot of useful initial information about the various Eclipse components and how they interact with each other. Take a few minutes to read this material, and then let's dive into Eclipse's Java Development Tools (JDT). The best way to learn something - to try it in practice.

    Continuing this short tour of Eclipse, we will create a new Java project. Select File> New> Java Project (File> New> Java Project) and type Hello when prompted for a project name, then click Finish.

    Now let's look at the "Java" perspective (if you're not already there). Depending on how you like to control your screen, you can either change the perspective of the current window by selecting Window > Open Perspective > Java (Window > Open Perspective > Java), or open a new window by selecting Window> New Window (Window> New Window), and choose a new perspective.

    As you might expect, the Java perspective has a set of views designed for Java development. One of them, located in the upper left corner, is a hierarchy containing various Java packages, classes, JAR archives, and miscellaneous files. This view is called the Package Explorer. Please note that two new items have been added to the main menu: Source and Refactor.

    Java Development Tools (JDT)

    To try out the Java development environment, we will create and run an application called "Hello World". From the Java perspective, right-click on the "Hello" project source test folder (src) and select New> Class (New> Class), as shown in Figure 3. In the dialog box that appears, enter Hello as the class name. Below the inscription Which method stubs would you like to create? (What method stubs would you like to create?) note public static void main(Stringargs) and press Finish.

    Figure 3. Creating a new class in Java perspective

    This will create a .java file with the Hello class and an empty main() method in the editor area, as shown in Figure 4. Add the following code to the method (note that the description for i was deliberately omitted).

    Figure 4. The Hello class in the Java editor

    As you type, you'll notice some of the features of the Eclipse editor, including syntax checking and code completion. Also, when you enter an opening parenthesis or double quotes, Eclipse automatically inserts a closing pair for them and places the cursor in the middle.

    In other cases, you can trigger automatic code completion using the combination ctrl+1. The code completion function produces a context-sensitive list of options from which you can select using the keyboard or mouse. Variants can be a list of methods specific to a particular object, or a piece of code based on various keywords such as for or while .

    Syntax checking depends on incremental compilation. As you save code, it is compiled in the background and checked for syntax errors. By default, syntax errors are underlined in red, and a red dot with a white X appears in the margin to the left. Other errors are marked in the margin of the editor with a light bulb symbol; these are issues that the editor could fix for you (a feature called Quick Fix).

    In the code above, the lightbulb sign is next to the for statement because the description for i was omitted. Double-clicking on a light bulb will bring up a list of suggested fixes. In our case, it will be proposed to create a class field i , a local variable i or a parameter i for the method; selecting any of these options with the mouse will show the code that will be generated. Figure 5 shows the list of suggested options and the code suggested in the case of a local variable.

    Figure 5. Options offered by the Quick Fix feature

    Double-clicking on a sentence inserts the code at the right place in the program.

    If the program compiles without errors, you can run it by selecting Run in the Eclipse menu. (Note that there is no separate compilation step, because compilation happens as you save code. If your code doesn't have syntax errors, it's ready to run.) The "Launch Configurations" dialog appears with the correct defaults; click Run bottom right. A new tabbed panel (Console) appears in the bottom panel, displaying the output of the program, as shown below.

    Figure 6. The result of the program

    You can also run the program in the Java debugger. First, you need to set a breakpoint in main() System.out.println() by double-clicking on the gray box on the left side of the edit box next to the call to System.out.println() . A blue dot will appear. On the menu Run select a team Debug. As described earlier, the "Launch Configurations" dialog will appear. Choose a team Run. The perspective will automatically change to the Debug perspective, which contains a number of interesting new views, as shown below.

    Figure 7. Debug perspective

    Notice the Debug view in the upper left corner of the perspective. This view shows the call stack and contains a toolbar in the title bar that allows you to control program execution. The panel has buttons for continuing, pausing, or terminating the program, moving to the next statement, stepping over the next statement, or returning from a method. The panel at the top right contains a number of tabbed views, including Variables (Variables), Breakpoints (Control points), Expressions (Expressions) and Display (Display). The Variables tab is now selected, so we can see the current value of the variable i .

    More detailed information about any of the views can be obtained using the context help; To do this, click on the title of the view and click F1.

    Additional plugins

    In addition to plugins like JDT for editing, compiling, and debugging applications, there are plugins that support the entire development process: modeling, build automation, unit testing, performance testing, versioning, and configuration.

    Eclipse includes a Concurrent Versions System (CVS) plugin for source code management. The Team plugin connects to a CVS server, allowing members of a development team to work on a set of source files without interfering with changes made by others. We will not go into more detail here about management. source code from Eclipse, as this will require the installation of a CVS server, although the ability to support a development team, and not just self-development, is an important and integral part of Eclipse.

    Plugins maintained and distributed by the Eclipse Foundation can be found on the Eclipse Web site. The most complete list of available plugins is available on the Eclipse Plug-in Central page, which serves as a directory of plugins.

    Eclipse platform architecture

    The Eclipse platform contains a powerful set of plugins (see Figure 8) that support projects such as JDT and PDE.

    Figure 8. Simplified architecture of the Eclipse platform

    The dark blue boxes represent the components that are the central part of the Rich Client Platform (RCP) in Eclipse. The very concept of RCP is beyond the scope of this article, but let's think of RCP as just a set of plug-ins from Eclipse that people can use in application development, such as Lotus Notes® 8. The light blue boxes represent optional (though recommended) components to enable. into RCP-based applications. And the gray blocks are completely optional. The platform consists of several components, we will look at some of them:

    runtime Runtime is the code that defines the Eclipse plug-in model, based on the OSGi specification and the notion of extensions and extension points. Runtime also provides additional services such as syslog and concurrency. JFace/SWT The Standard Widget Toolkit (SWT) is a set of widgets responsible for the user interface and functionality of Eclipse. JFace is simply an add-on to SWT that provides several Model-View-Controller (MVC) classes to facilitate the development of graphical applications. Workbench (Workspace) The workspace gives Eclipse its personality. It is at this level that the concept of views, perspectives, and things like editing windows is implemented. Help (User Support) This Eclipse component allows you to provide support to your users. This can be done through the help system, which allows users to search for help documentation, or through cheat sheets, which can be presented to end users as interactive task lists. Update The update component provides Eclipse with the means to update applications from one version to another. Team (Team) The team component is a framework that allows developers to plug in their own version control systems. A sample provider implementation is the CVS plugin built into Eclipse.

    Conclusion

    From the original code written by IBM, Eclipse has grown into a fully functional open source ecosystem with more than 100 participating companies. A portable, extensible open source framework is no longer a new idea, but with a well thought out, robust, and elegant design, Eclipse takes on a whole new dynamic.

    Welcome to the Eclipse ecosystem. Our goal was to help you get up to speed on the Eclipse platform. We achieved this with an introductory text and a simple practice exercise. Use the knowledge gained from reading this article and become an active member of the Eclipse ecosystem.

    Eclipse is a Java-based open source extensible development platform. In fact, it is just a development environment and a set of services for building applications based on embedded components (plugins). Fortunately, Eclipse comes with a standard set of plug-ins, including the well-known Java Development Tools (JDT).

    While most users who use Eclipse as their Java Integrated Development Environment (IDE) are quite happy with it, it has much more to offer. Eclipse also includes a Plugin Development Environment (PDE), which will primarily be of interest to those who want to extend Eclipse itself, as it allows you to create your own tools that are built into the Eclipse environment. Since Eclipse is entirely plug-in, all toolkit developers have the opportunity to offer extensions to Eclipse and provide users with a consistent and seamless integrated development environment (IDE).

    This integrity and consistency is not unique to Java development tools. Although Eclipse is written in Java, it can be used with other languages ​​as well. For example, plugins already exist (or are being developed) that support such programming languages ​​as C/C++ and COBOL. The Eclipse framework can also be used as the basis for other types of applications not related to software development, such as content management systems.

    An excellent example of an Eclipse-based application is IBM Rational Software Architect, which is the foundation of IBM's family of Java development tools.

    Eclipse is open source

    Open source software is released under a license intended to guarantee certain rights to users. The most obvious of these, of course, is that the source code must be provided to users, and they have every right to modify and redistribute the software themselves. This protection of user rights is achieved through a mechanism called "copyleft": The software license stands for copyright protection (copyright) and prohibits redistribution of the software unless the user is granted such rights. The copyleft license also requires that all software distributed by users be covered by the original license without modification. Thus, the meaning of copyright is essentially turned on its head, and a copyleft license, which uses copyright to give the user rights, and not to save them to the software developer, is often jokingly said "all rights are perverted" (all rights reversed).

    Much of the common fear, uncertainty, and doubt about open source software is based on the so-called viral nature of some copyleft licenses. The idea is that if you use open source software as part of your own development program, you will lose your intellectual property because the license will "contaminate" your private parts of the program. In other words, the license may require that all software incorporating open source software, including any newly created software, be distributed under the same license. While this is true of the best-known copyleft license, the GNU General Public License (under which, for example, Linux is distributed), there are other licenses that strike a different balance between commercial and public interests.

    The Open Software Initiative - OSI (Open Source Initiative) is a non-profit organization that clearly defines what constitutes open source and certifies licenses that meet its criteria. Eclipse is distributed under the EPL - Eclipse Public License (Open Eclipse License) V1.0, approved by OSI and aimed at facilitating commercial acceptance of Eclipse, while maintaining loyalty to the authors of the source code.

    Those who create plug-ins for Eclipse or use Eclipse as a base for software development are required to publish any Eclipse code they use or modify under the EPL license, but are free to license their own add-ons as they please. Native code bundled with software from Eclipse does not need to be licensed as open source, and the source code itself does not need to be made public.

    While most programmers won't use Eclipse to develop plug-ins or create new products based on it, the open source nature of Eclipse is important not only because it makes Eclipse available for free (and despite the fact that the commercially oriented the license implies that plugins can cost money). Open source promotes innovation and creates an incentive for developers (even commercial ones) to contribute their source code to the community. There are several reasons for this, but perhaps the most significant is that the more developers contribute to the project, the more significant it becomes for everyone. And when a project becomes useful, more and more developers will use it and build a community around it, similar to those that have formed around Apache and Linux.

    What is Eclipse?

    Eclipse is an open source developer community whose projects aim to build an open development platform consisting of extensible development environments, tools, and runtime libraries for building, deploying, and managing software during its life cycle. The Eclipse Foundation is a non-profit, member-supported association that hosts Eclipse projects and helps advance the open source community and ecosystem of complementary products and services.

    The Eclipse project was created in November 2001 by IBM and supported by a consortium of software vendors. The Eclipse Foundation was established in January 2004 as an independent, non-profit organization that serves as the steward of the Eclipse community. It was created to help a vendor independent, open and transparent community grow around Eclipse. Today's Eclipse community is made up of individuals and organizations representing the software industry.

    The Eclipse Foundation oversees and directs the ongoing development of Eclipse. The Foundation serves the community, but the open source developers, called committers, who essentially work on Eclipse projects, are not on its staff. Typically, Eclipse committers are either in an organization or are independent developers who volunteer their time to work on an open source project.

    Now that we've looked at the theoretical, historical, and political aspects of Eclipse, let's take a look at the product itself.

    Eclipse workspace

    When you first start Eclipse, you will see a welcome page inside the workspace (see Figure 1). The Eclipse user has several options to navigate to the overview page, which is what I recommend doing (see Figure 2). Next, you can read information about new features, explore some examples, or take a tutorial.

    Figure 2. Eclipse overview page

    The Eclipse workspace consists of several panels called views, such as navigator or outline views. A set of such representations is called a perspective. One of the most common perspectives is the Resources perspective, which is a basic set of views for managing projects and viewing and editing project files.

    I recommend that most novice users start at the overview page shown in Figure 2 and learn more about Eclipse. The workbench basics section contains a lot of useful initial information about the various Eclipse components and how they interact with each other. Take a few minutes to read this material, and then let's dive into Eclipse's Java Development Tools (JDT). The best way to learn something is to try it out.

    Continuing this short tour of Eclipse, we will create a new Java project. Select File> New> Java Project (File> New> Java Project) and type Hello when prompted for a project name, then click Finish.

    Now let's look at the "Java" perspective (if you're not already there). Depending on how you like to control your screen, you can either change the perspective of the current window by selecting Window > Open Perspective > Java (Window > Open Perspective > Java), or open a new window by selecting Window> New Window (Window> New Window), and choose a new perspective.

    As you might expect, the Java perspective has a set of views designed for Java development. One of them, located in the upper left corner, is a hierarchy containing various Java packages, classes, JAR archives, and miscellaneous files. This view is called the Package Explorer. Please note that two new items have been added to the main menu: Source and Refactor.

    Java Development Tools (JDT)

    To try out the Java development environment, we will create and run an application called "Hello World". From the Java perspective, right-click on the "Hello" project source test folder (src) and select New> Class (New> Class), as shown in Figure 3. In the dialog box that appears, enter Hello as the class name. Below the inscription Which method stubs would you like to create? (What method stubs would you like to create?) note public static void main(Stringargs) and press Finish.

    Figure 3. Creating a new class in Java perspective

    This will create a .java file with the Hello class and an empty main() method in the editor area, as shown in Figure 4. Add the following code to the method (note that the description for i was intentionally omitted).

    Figure 4. The Hello class in the Java editor

    As you type, you'll notice some of the features of the Eclipse editor, including syntax checking and code completion. Also, when you enter an opening parenthesis or double quotes, Eclipse automatically inserts a closing pair for them and places the cursor in the middle.

    In other cases, you can trigger automatic code completion using the combination ctrl+1. The code completion function produces a context-sensitive list of options from which you can select using the keyboard or mouse. Variants can be a list of methods specific to a particular object, or a piece of code based on various keywords such as for or while .

    Syntax checking depends on incremental compilation. As you save code, it is compiled in the background and checked for syntax errors. By default, syntax errors are underlined in red, and a red dot with a white X appears in the margin to the left. Other errors are marked in the margin of the editor with a light bulb symbol; these are issues that the editor could fix for you (a feature called Quick Fix).

    In the code above, the lightbulb sign is next to the for statement because the description for i was omitted. Double-clicking on a light bulb will bring up a list of suggested fixes. In our case, it will be proposed to create a class field i , a local variable i or a parameter i for the method; selecting any of these options with the mouse will show the code that will be generated. Figure 5 shows the list of suggested options and the code suggested in the case of a local variable.

    Figure 5. Options offered by the Quick Fix feature

    Double-clicking on a sentence inserts the code at the right place in the program.

    If the program compiles without errors, you can run it by selecting Run in the Eclipse menu. (Note that there is no separate compilation step, because compilation happens as you save code. If your code doesn't have syntax errors, it's ready to run.) The "Launch Configurations" dialog appears with the correct defaults; click Run bottom right. A new tabbed panel (Console) appears in the bottom panel, displaying the output of the program, as shown below.

    Figure 6. The result of the program

    You can also run the program in the Java debugger. First, you need to set a breakpoint in main() System.out.println() by double-clicking on the gray box on the left side of the edit box next to the call to System.out.println() . A blue dot will appear. On the menu Run select a team Debug. As described earlier, the "Launch Configurations" dialog will appear. Choose a team Run. The perspective will automatically change to the Debug perspective, which contains a number of interesting new views, as shown below.

    Figure 7. Debug perspective

    Notice the Debug view in the upper left corner of the perspective. This view shows the call stack and contains a toolbar in the title bar that allows you to control program execution. The panel has buttons for continuing, pausing, or terminating the program, moving to the next statement, stepping over the next statement, or returning from a method. The panel at the top right contains a number of tabbed views, including Variables (Variables), Breakpoints (Control points), Expressions (Expressions) and Display (Display). The Variables tab is now selected, so we can see the current value of the variable i .

    More detailed information about any of the views can be obtained using the context help; To do this, click on the title of the view and click F1.

    Additional plugins

    In addition to plugins like JDT for editing, compiling, and debugging applications, there are plugins that support the entire development process: modeling, build automation, unit testing, performance testing, versioning, and configuration.

    Eclipse includes a Concurrent Versions System (CVS) plugin for source code management. The Team plugin connects to a CVS server, allowing members of a development team to work on a set of source files without interfering with changes made by others. We won't explore Eclipse's source control here in more detail, as this will require the installation of a CVS server, although the ability to support a development team, not just self-development, is an important and integral part of Eclipse.

    Plugins maintained and distributed by the Eclipse Foundation can be found on the Eclipse Web site. The most complete list of available plugins is available on the Eclipse Plug-in Central page, which serves as a directory of plugins.

    Eclipse platform architecture

    The Eclipse platform contains a powerful set of plugins (see Figure 8) that support projects such as JDT and PDE.

    Figure 8. Simplified architecture of the Eclipse platform

    The dark blue boxes represent the components that are the central part of the Rich Client Platform (RCP) in Eclipse. The very concept of RCP is beyond the scope of this article, but let's think of RCP as just a set of plug-ins from Eclipse that people can use in application development, such as Lotus Notes® 8. The light blue boxes represent optional (though recommended) components to enable. into RCP-based applications. And the gray blocks are completely optional. The platform consists of several components, we will look at some of them:

    runtime Runtime is the code that defines the Eclipse plug-in model, based on the OSGi specification and the notion of extensions and extension points. Runtime also provides additional services such as syslog and concurrency. JFace/SWT The Standard Widget Toolkit (SWT) is a set of widgets responsible for the user interface and functionality of Eclipse. JFace is simply an add-on to SWT that provides several Model-View-Controller (MVC) classes to facilitate the development of graphical applications. Workbench (Workspace) The workspace gives Eclipse its personality. It is at this level that the concept of views, perspectives, and things like editing windows is implemented. Help (User Support) This Eclipse component allows you to provide support to your users. This can be done through the help system, which allows users to search for help documentation, or through cheat sheets, which can be presented to end users as interactive task lists. Update The update component provides Eclipse with the means to update applications from one version to another. Team (Team) The team component is a framework that allows developers to plug in their own version control systems. A sample provider implementation is the CVS plugin built into Eclipse.

    Conclusion

    From the original code written by IBM, Eclipse has grown into a fully functional open source ecosystem with more than 100 participating companies. A portable, extensible open source framework is no longer a new idea, but with a well thought out, robust, and elegant design, Eclipse takes on a whole new dynamic.

    Welcome to the Eclipse ecosystem. Our goal was to help you get up to speed on the Eclipse platform. We achieved this with an introductory text and a simple practice exercise. Use the knowledge gained from reading this article and become an active member of the Eclipse ecosystem.

    mob_info