How to Write a Java Program in Eclipse and it's Benefits

If you are learning Java and looking to use free IDE then we would recommend to use Eclipse IDE. Let us see how to write Java program in Eclipse and it’s benefits.

A Java IDE (Integrated Development Environment) is a software application which helps the user to code easily and debugs Java program in a much easier manner. IDE’s typically provide an editor, a compiler, an interpreter, and a debugger.

Eclipse is most widely used IDE for Java Developers and after it how to create and execute your first java program on eclipse

  • Firstly, to download eclipse click on the following link DownloadEclipse and after it click on download button as shown in this figure which will redirect you to the latest version of it

Download Eclipse

  • After downloading it successfully you will see a folder structure as shown below and in which double click on eclipse icon to launch it and select workspace where you want to save your codes

Eclipse Folder Structure

  • After eclipse is launched click on File–>New–>Project–>Java Project

Selecting Java Project

  • After Selecting Java project, enter Name of the project and click finish button. After this create a new class by right-clicking on source Folder and select “Class” option from the menu where you will be giving class Name(should always start with an uppercase letter) and leave other options as it is and at last click on finish button.

Creating Java Class

  • A java editor will open where you will write your code and click on “Run” icon in the menu bar and after this, you will see the “Output” in the console as shown in the figure

Java program with output
 

Benefits of using IDE for writing java program are as follows:

  • It helps in auto-completing names, as when number of functions and variables available are large in number it is difficult to remember them all
  • You can easily navigate through your code just by clicking on method name
  • It becomes very easy to debug the code as it shows you the line number where bugs have occurred
  • Autosave feature is amazing even your system crashes in between your code will be saved
  • Code highlight, syntax validation, auto code formatting
  • Output of the executed code is also displayed in a good manner due to user-friendly GUI

Leave a Reply

Contact Us
close slider
Contact Us

How can we help you with?