Chapter 1. Eclipse 4.13.0

Red Hat Developer Tools, available for Red Hat Enterprise Linux 7, includes Eclipse 4.13.0, which is based on the Eclipse Foundation’s 2019-09 release train.

Eclipse is a powerful development environment that provides tools for each phase of the development process. It integrates a variety of disparate tools into a unified environment to create a rich development experience, provides a fully configurable user interface, and features a pluggable architecture that allows for extension in a variety of ways. For instance, the Valgrind plug-in allows programmers to perform memory profiling, that is otherwise performed on the command line through the Eclipse user interface.

Figure 1.1. Sample Eclipse Session

Sample Eclipse Session

Eclipse provides a graphical development environment alternative to traditional interaction with command-line tools, and it is a welcome alternative for developers who do not want to use the command-line interface. The traditional, mostly command-line-based Linux tools (such as gcc or gdb) and Eclipse offer two distinct approaches to programming.

For an overview on how to develop applications for Red Hat JBoss Middleware or for support for OpenShift Tools, see Red Hat Developer Studio.

Table 1.1. Eclipse Components Included in rh-eclipse package collection:

PackageDescription

rh-eclipse-eclipse-cdt

The C/C++ Development Tooling (CDT) that provides features and plug-ins for development in these two languages.

rh-eclipse-eclipse-changelog

The ChangeLog plug-in that allows you to create and maintain changelog files.

rh-eclipse-eclipse-dtp

Eclipse Data Tools Platform Project

rh-eclipse-eclipse-egit

EGit, a team provider for Eclipse that provides features and plug-ins for interaction with Git repositories.

rh-eclipse-eclipse-emf

The Eclipse Modeling Framework (EMF) that allows you to build applications based on a structured data model.

rh-eclipse-eclipse-epp-logging

The Eclipse error reporting tool.

rh-eclipse-eclipse-gcov

The GCov plug-in that integrates the GCov test coverage program with Eclipse.

rh-eclipse-eclipse-gef

The Graphical Editing Framework (GEF) that allows you to create a rich graphical editor from an existing application model.

rh-eclipse-eclipse-gprof

The Gprof plug-in that integrates the Gprof performance analysis utility with Eclipse.

rh-eclipse-eclipse-jdt

The Eclipse Java development tools (JDT) plug-in.

rh-eclipse-eclipse-jgit

JGit, a Java implementation of the Git revision control system.

rh-eclipse-eclipse-manpage

The Man Page plug-in that allows you to view manual pages in Eclipse.

rh-eclipse-eclipse-mpc

The Eclipse Marketplace Client.

rh-eclipse-eclipse-mylyn

Mylyn, a task management system for Eclipse.

rh-eclipse-eclipse-pde

The Plugin Development Environment for developing Eclipse plugins.

rh-eclipse-eclipse-perf

The Perf plug-in that integrates the perf tool with Eclipse.

rh-eclipse-eclipse-ptp

A subset of the PTP project that provides support for synchronized projects.

rh-eclipse-eclipse-pydev

A full featured Python IDE for Eclipse.

rh-eclipse-eclipse-remote

The Remote Services plug-in that provides an extensible remote-services framework.

rh-eclipse-eclipse-rpm-editor

The Eclipse Spec File Editor that allows you to maintain RPM spec files.

rh-eclipse-eclipse-systemtap

The SystemTap plug-in that integrates SystemTap with Eclipse.

rh-eclipse-eclipse-subclipse

Subclipse, a team provider for Eclipse that provides features and plug-ins for interaction with Subversion repositories.

rh-eclipse-eclipse-valgrind

The Valgrind plug-in that integrates Valgrind with Eclipse.

rh-eclipse-eclipse-webtools

The Eclipse Webtools plug-ins.

1.1. Getting Access to Eclipse on Red Hat Enterprise Linux 7

Eclipse is an offering that is distributed as a part of the Red Hat Developer Tools content set, which is available to customers with deployments of Red Hat Enterprise Linux 7. In order to install Eclipse, enable the Red Hat Developer Tools and Red Hat Software Collections repositories by using the Red Hat Subscription Management.

  1. Choose the system variant: workstation or server and modify the following commands:

    Note

    We recommend developers to use Red Hat Enterprise Linux Server for access to the widest range of development tools.

  2. Enable the rhel-7-variant-devtools-rpms repository:

    # subscription-manager repos --enable rhel-7-variant-devtools-rpms
  3. Enable the rhel-variant-rhscl-7-rpms repository:

    # subscription-manager repos --enable rhel-variant-rhscl-7-rpms
  4. Enable the rhel-7-variant-optional-rpms repository:

    # subscription-manager repos --enable rhel-7-variant-optional-rpms

Repositories are enabled. You can install Red Hat Eclipse as described in Section 1.2, “Installing Eclipse”.

Enabling the Red Hat Developer Tools debuginfo Repositories

Note

This step is optional.

Red Hat Developer Tools also provides the debuginfo packages for all architecture-dependent RPMs included in the repositories. These packages are useful for core-file analysis and for debugging of Eclipse itself.

  1. Enable the Red Hat Developer Tools debuginfo repositories, replace variant with the Red Hat Enterprise Linux system variant (server or workstation):

    # subscription-manager repos --enable rhel-7-variant-devtools-debug-rpms
    # subscription-manager repos --enable rhel-variant-rhscl-7-debug-rpms

For details about installing, understanding, and using the debuginfo packages, refer to Debugging a Running Application.

Additional Resources

1.2. Installing Eclipse

The Eclipse development environment is provided as a collection of RPM packages.

For a list of available components, see Table 1.1, “Eclipse Components Included in rh-eclipse package collection:”.

Note

Eclipse fully supports C, C++, and Java development, but does not provide support for the Fortran programming language.

Note

The rh-eclipse collection requires the rh-maven35 collection.

Procedure

  1. To install Eclipse, run the following command as the root user:

    # yum install rh-eclipse

1.3. Using Eclipse

To start Eclipse:

  1. Click Applications > Programming > Red Hat Eclipse, or type the following at a shell prompt:

    $ scl enable rh-eclipse eclipse
  2. During its startup, Eclipse prompts you to select a workspace that is a directory in which you want to store your projects. You can either use ~/workspace/, which is the default option, or click Browse to browse your file system and select a custom directory. Additionally, you can select the Use this as the default and do not ask again check box to prevent Eclipse from displaying this dialog box the next time you run this development environment.
  3. Click OK to confirm the selection and proceed with the startup.

1.3.1. Using the Red Hat Developer Toolset Toolchain

To use Eclipse with support for the GNU Compiler Collection and binutils from Red Hat Developer Toolset:

  1. Ensure that devtoolset-9.0-toolchain is installed and run the application as described in Section 1.3, “Using Eclipse”. The rh-eclipse collection uses the Red Hat Developer Toolset toolchain by default.

For detailed instructions on how to install the devtoolset-9.0-toolchain package on your system, see the Red Hat Developer Toolset User Guide Section 1.5. Installing Red Hat Developer Toolset.

Important

Discard all previous build results for projects previously built with the Red Hat Enterprise Linux version of the GNU Compiler Collection. To do so, open the project in Eclipse and select Project > Clean from the menu.

1.3.2. Using the Red Hat Enterprise Linux Toolchain

To use Eclipse with support for the toolchain distributed with Red Hat Enterprise Linux, change the configuration of the project to use absolute paths to the Red Hat Enterprise Linux system versions of gcc, g++, and as.

To configure Eclipse to explicitly use the Red Hat Enterprise Linux system versions of the tools for the current project:

  1. In the C/C++ perspective, click Project > Properties to open the project properties.
  2. In the menu on the left-hand side of the dialog box, click C/C++ Build > Settings.
  3. Click the Tool Settings tab.
  4. If you are working on a C project:

    1. Select GCC C Compiler or Cross GCC Compiler and change the value of the Command field to:

      /usr/bin/gcc
    2. Select GCC C Linker or Cross GCC Linker and change the value of the Command field to:

      /usr/bin/gcc
    3. Select GCC Assembler or Cross GCC Assembler and change the value of the Command field to:

      /usr/bin/as
  5. If you are working on a C++ project:

    1. Select GCC C Compiler* or *Cross G Compiler and change the value of the Command field to:

      /usr/bin/g++
    2. Select GCC C Compiler or Cross GCC Compiler and change the value of the Command field to:

      /usr/bin/gcc
    3. Select GCC C Linker* or *Cross G Linker and change the value of the Command field to:

      /usr/bin/g++
    4. Select GCC Assembler or Cross GCC Assembler and change the value of the Command field to:

      /usr/bin/as
  6. Click OK to save the configuration changes.

1.4. Additional Resources

A detailed description of Eclipse and all its features is beyond the scope of this document. For more information, see the following resources.

Installed Documentation

  • Eclipse includes a built-in help system that provides extensive documentation for each integrated feature and tool.

See Also

  • Chapter 2, Changes in Eclipse 4.13.0 provides a list of selected features and improvements over the Eclipse development environment included in the previous release of Developer Tools.
  • The Red Hat Developer Toolset chapter in the User Guide provides an overview of Red Hat Developer Toolset and more information on how to install it on your system.
  • The GNU Compiler Collection (GCC) chapter in the User Guide provides information on how to compile programs written in C, C++, and Fortran on the command line.