How To Install Eclipse and Get Started With Java Programming
How To Install Eclipse and Get Started With Java Programming
Eclipse is popular for Java application development (Java SE and Java EE) and Android
apps. It also supports C/C++, PHP, Python, Perl, and other web project developments via
extensible plug-ins. Eclipse is cross-platform and runs under Windows, Linux and
macOS.
Eclipse Versions
The various versions are:
Eclipse 1.0 (November 7, 2001): based on an earlier Java IDE called VisualAge
from IBM.
Eclipse 2.0 (June 28, 2002)
Eclipse 2.1 (March 28, 2003)
Step 1: Download
Download Eclipse from https://www.eclipse.org/downloads/packages/. Choose "Eclipse
IDE for Java Developers" and "Windows x86_64" (e.g., "eclipse-java-202x-xx-R-win32-
x86_64.zip" - about 325MB) ⇒ Download.
Step 2: Unzip
To install Eclipse, simply unzip the downloaded file into a directory of your choice (e.g.,
"c:\myProject").
I prefer the zip version, because there is no need to run any installer. Moreover, you can
simply delete the entire Eclipse directory when it is no longer needed (without running
any un-installer). You are free to move or rename the directory. You can install (unzip)
multiple copies of Eclipse in the same machine.
To install Eclipse:
1. Goto https://www.eclipse.org/downloads/package/. Choose "Eclipse IDE for
Java Developers" and "macOS AArch64" (for M1/M2 ARM Processor) or
"macOS x86_64" (for Intel processor). To find out which processor your mac
has, google "How to tell what processor your mac has".
You will receive a Disk Image (DMG) file.
2. Double-click the downloaded DMG file. Follow the screen instructions to
install Eclipse. Eclipse will be installed under " /Applications/eclipse". (To
check and confirm!)
Step 2: Write a Hello-world Java Program (or "Java Class") under the
created project
1. In the "Package Explorer" (left pane) ⇒ Right-click on "FirstProject" (or use
the "File" menu) ⇒ New ⇒ Class.
2. The "New Java Class" dialog pops up.
a. In "Source folder", keep the "FirstProject".
b. In "Package", leave it EMPTY. Delete the content if it is not
empty.
c. In "Name", enter "Hello".
d. Check "public static void main(String[] args) ".
e. Don't change the rest.
Push "Finish" button.
3. The source file "Hello.java" opens on the editor panel (the center pane).
Enter the following codes:
4. public class Hello {
5. public static void main(String[] args) {
6. System.out.println("hello, world");
7. }
}
NOTES:
You should create a NEW Java "project" for EACH of your Java application.
Nonetheless, Eclipse allows you to keep more than one programs (classes) in
a project, which is handy for writing toy programs (such as your tutorial
exercises - you can keep many exercises in one project). To run a particular
program, open and right-click on the source file ⇒ Run As ⇒ Java Application.
Clicking the "Run" button (with a "Play" icon) runs the recently-run program
(based on the previous configuration). Try clicking on the "down-arrow"
besides the "Run" button.