Install Eclipse For Java and C++ Development
Install Eclipse For Java and C++ Development
Introduction
Eclipse is a popular integrated development environment (IDE) for developing Java and C++ applications.
You can install plugins that provide special features for specialized development frameworks, such as
ANTLR 4.
You can download, configure, build, and install Eclipse on Ubuntu, MacOS X, or Windows 10. If you want
to run on Ubuntu, first read the following tutorials:
The process to install Eclipse on any of the three platforms is similar. The Ubuntu and MacOS X
platforms are recommended over Windows 10, as the latter may have compatibility problems when you
development programs.
For MacOS X, download the latest .dmg image (currently jdk-13.0.2_osx-x64_bin.dmg) and
install from that image.
For Ubuntu, download the latest Linux .tar.gz compressed installer file
(currently jdk-13.0.2_linux-x64_bin.tar.gz). First unzip the file with the gunzip utility
program, and then unarchive with the tar utility. For example:
gunzip jdk-13.0.2_linux-x64_bin.tar.gz
tar -xvf jdk-13.0.2_linux-x64_bin.tar
which will create a jdk-13.0.2 directory containing Java and its utility programs.
1
R. Mak, Install Eclipse for Java and C++ Development
Edit the .bashrc file in your home directory (it might instead be .bash_profile in MacOS X) to set
and export JAVA_HOME to point to the installed jdk directory. For example:
export JAVA_HOME=/home/rmak/jdk-13.0.2
Otherwise, you need to type the above as a command each time you open a terminal window.
If you are using the Ubuntu subsystem of Windows 10, use a browser in Windows (such as
Microsoft Edge) to download the .tar.gz compressed installer file. Then in the Ubuntu terminal
window, use the mv command to move the installer file out of the Windows downloads directory
into your Ubuntu home directory. Use /mnt/c or /mnt/d to access directories and files in the
Windows file system. For example, from your Ubuntu home directory, enter a command like:
mv /mnt/c/Users/rmak/Downloads/jdk-13.0.2_linux-x64_bin.tar.gz .
The final dot represents the current directory (your home directory). Then proceed as described
above with gunzip and tar to create the subdirectory jdk-13.0.2 in your home directory.
See the boxed note above about downloading installer files if you’re using Ubuntu on Windows 10.
2
R. Mak, Install Eclipse for Java and C++ Development
When the installation is complete, launch Eclipse (Figure 2). Eclipse is now ready for you to develop Java
projects.
Right-click in the Project Explorer panel at the left. From the context menu, choose New | Java Project.
Enter a project name, such as “MergeSort” (Figure 3). Click the Finish button.
3
R. Mak, Install Eclipse for Java and C++ Development
Now you’re ready to edit, compile, and run your Java program (Figure 5).
4
R. Mak, Install Eclipse for Java and C++ Development
If you are going to develop only Java projects, then you are done installing Eclipse,
and you do not need to read the rest of this tutorial.
5
R. Mak, Install Eclipse for Java and C++ Development
From the Help dropdown menu at the top of the Eclipse window, choose Install New Software … A
dialog box opens for you to choose which plugins to install (Figure 7). Enter the URL
http://download.eclipse.org/tools/cdt/releases/9.10 into the Work with box and press the return key.
Select CDT Main Features (Figure 6).
Click the Next button twice, accept the terms of the license, and click the Finish button. Wait for the
plugin to finish installing. Eclipse will then prompt you to restart it.
6
R. Mak, Install Eclipse for Java and C++ Development
7
R. Mak, Install Eclipse for Java and C++ Development
Now you’re ready to edit, compile, and run your C++ program (Figure 11).
8
R. Mak, Install Eclipse for Java and C++ Development