The best tools to make your project dreams come true

Login or Signup
USD

9/14/2018 | By Maker.io Staff

How to Install Eclipse on a Raspberry Pi

Eclipse is a very useful IDE for programming in languages such as Java, Python, and even C++. In this how-to article, we will learn how to install Eclipse on Raspbian.

Things You Will Need

To properly install Eclipse on your Raspberry Pi, you don’t need much in the way of supplies. Altogether, you will need the following:

Install the IDE

While the terminal may be daunting to some, it is a lot easier to use than most may think. Since we will be using the terminal, we have to go ahead and load it up.

How to Install Eclipse on a Raspberry Pi

We can do that from the desktop using the tool bar.

With the terminal window open, we need to run an instruction that will update our Raspbian packages. Enter the following:

“sudo apt-get update” make clear that this is command

The next step is the instruction that will actually install Eclipse. I’ve included the instruction below.

“sudo apt-get install eclipse” make clear that this is command

During installation, the terminal window will prompt you, asking whether or not you want to install Eclipse. At this point, enter Y and then hit enter. Eclipse is a somewhat large program (in excess of 300 MB), so the installation process may take a while.

How to Install Eclipse on a Raspberry Pi

A Basic Example of Setting Up Eclipse

With the installation finished, you may see some errors in the terminal window, but these should not cause any issues. To load Eclipse, navigate to the Raspbian Icon > Programming > Eclipse.

How to Install Eclipse on a Raspberry Pi

When Eclipse starts, you will be asked where the default workspace should be located. Leave it as the default value and click “OK”.

How to Install Eclipse on a Raspberry Pi

Now that Eclipse is ready to go, we will learn how to make a simple “Hello World” program. Start by clicking File > New > Project.

How to Install Eclipse on a Raspberry Pi

In the window that opens, scroll down to the Java folder and select “Java Project”.

How to Install Eclipse on a Raspberry Pi

In the next window, give the project a name. In my case, I called the project “OurFirstProject”.

How to Install Eclipse on a Raspberry Pi

Now that our project has been created, we need to make the main class that will hold our code. We will execute this class. To do this, right-click the project in the Package Explorer and then click New > Class.

How to Install Eclipse on a Raspberry Pi

The first field that we need to fill out is the “Package”. For our Java project, we will call the package “helloWorld”. The second field that needs filling in is “Name”. For this example, we will call the class “Main”. Packages in Java should start with a lowercase letter, and classes should start with an uppercase letter.

How to Install Eclipse on a Raspberry Pi

Now that we have our class and package made, we will need to put in a line of code that will print “Hello World” on the console window. To open the main class file, expand the project in the Package Explorer, expand the “src” folder, and then double-click “Main.java”.

System.out.println(“Hello World”);

How to Install Eclipse on a Raspberry Pi

Finally, we need to go ahead and test the program. You can do this by clicking the green run button found in the toolbar. If all goes to plan, you should see the text “Hello World” in the console window at the bottom of the IDE.

How to Install Eclipse on a Raspberry Pi