Programming 101 - How to Download Eclipse and Code a Basic “Hello World” Print Statement in Java
By: Andrew DePero
What you will be learning
If this is your first time coding, you will be learning the very basics on how to initialize a program in Java. This guide takes you through all the steps you will need to get set up with an IDE, or a program with an interface that you can write and run code, as well as how to set up a very basic program that prints something simple, like “Hello World.”
Why learn basic programming?
Computers are becoming increasingly prevalent in all aspects of society, even outside the realm of programming and computer science. Having even a basic understanding of some of the concepts of programming can make you stand out, and may give extra opportunities and promotions in any career.
Why learn to use Eclipse?
Eclipse is a very common IDE used by beginning and advanced software developers. There’s different versions for different computing languages, so learning it can be beneficial if you want to switch languages while keeping a familiar interface. While it may be a little confusing to get used to, Eclipse offers many extra tools and functions to make certain programming aspects easier.
Materials
Windows or Mac laptop or desktop with a JDK installed. This is the java compiler and your programs cannot run without it.
**NOTE** The following demonstration is for Windows users. Mac should be similar, and the code is the same, but there may be differences in installing and running programs.
**NOTE** If you already have eclipse installed on your computer and have selected your working directory, skip to heading #3.
1. Downloading Eclipse Installer
Note: Eclipse may take a long time to install.
2. Getting Eclipse Set Up
This section goes over the basic startup procedure when you open Eclipse for the first time. You will be asked to choose a directory for your workspace. The workspace is where all of your project files will be stored. Then it takes you to a welcome screen that isn’t entirely useful, so if you want, you can uncheck the box in the bottom right hand corner to open straight to the workbench in the future.
3. Getting Your Program Set Up
This section goes over creating a project in Eclipse. Projects are made up of the file(s) that are used to run your code.
4. Creating Your Class
Now that your project is set up, you now need to create a class where you will actually type out your code. This is the code that actually runs when you run your program. When naming classes, it’s important to note that the name for your class cannot contain spaces or other strange characters, and it’s common practice to start with a capital letter and use lowercase letters, and start new words with capital letters.
5. Writing Your Code
Now that your project and class are set up, it’s finally time to write your code. It’s important to note that computer language is extremely specific, and must be entered exactly as it appears. Make sure to pay extremely close attention to capitalization and punctuation. One mistake and your program will not work properly.
public static void main(String[] args) {
System.out.println(“Hello World”);
Congratulations! You have successfully written a Java program. Now you can experiment and learn about other cool things you can do.