How to install eclipse and execute your first program in java


In this tutorial we will learn how to install eclipse and execute your first program in java, have a brief lookout on operators used in java programming and have a short description regarding it.

  • To learn how to install eclipse and execute your first program in java and to have a brief overview on operators follow the steps given below :

  1. Steps for installation of eclipse :
    1. First of all open up the browser.
    2. Open up google search engine and enter the keyword as download eclipse in it.
    3. google search engine

    4. Just select the eclipse kepler indicated by the arrow as shown in the above image.
    5. You will get the below screen where you have to select the eclipse IDE for your respective machine i.e 32/64 Bit.
    6. 3

    7. You will be navigated to the following screen :
    8. eclipse

    9. Just click on the download button as shown in the image and that’s it.
    10. After it gets downloaded you will get a compressed file of eclipse as shown in the image below:
    11. zip file for eclipse

    12. Now just right click on the zip folder and extract it. After extracting it just double click on the eclipse folder and you will get the following window :
    13. eclipse installation

    14. Now double click on the eclipse icon and it will ask you to save your workspace.
    15. saving workspace

    16. Click on browse button, set your workspace and then click ok. You will get the eclipse window as shown bwlow :
    17. eclipse window

    18. Here Installation of eclipse is completed.
  2. Steps for writing your first program in java
    1. click on File-> New-> Java Project as shown in the image.
    2. writing first program in java

    3. Now a dialog box will appear where you will be asked to specify your project name . After specifying your project name click on the Next button.
    4. project name dialog box

    5. After clcking on the next button you will get another dialog box as shown below where you have to click on the Finish button.
    6. Eclipse installation

    7. You can see your First Project created at the right hand side corner in the package explorer.
    8. Now double click on that project it will get expanded and you will see the src folder.
    9. Right click on src -> New -> Class as shown in the image.
    10. installation of eclipse

    11. A dialog box will appear where you have to enter the class name then choose the public method then click on Finish button.
    12. class name

    13. Your class will be created successfully and you will have the following window :
    14. first program in java

    15. Now in main method write the print statement i.e. “ System.out.println(“ ”) ”.
    16. And in the print statement in ” “ enter your message i.e. System.out.println(“This is my first program in eclipse”)
    17. So, you will have the following view of your window :
    18. java program

    19. Now click on save button which is indicated by an arrow in the above image.
    20. Now lets run the program.
    21. At the left hand side double click on your Project name -> src -> (default package).
    22. Now right click on our class name -> Run As -> Java Application.
    23. executing the first program in java

    24. Now the output will get displayed on the console.
    25. output

    26. Thus we have learned how to write and run a java program in eclipse.
  3. Operators and Conditions: –
    • We can divide operators in six groups: –

    1. Arithmetic Operators: –
    2. operators

    3. Bitwise Operators: –
      This operators works on bits and perform bitwise operations, it will give you result in binary format.
    4. Example :

      operators description

    5. Relational Operator: –
    6. Relational Operators

    7. Logical Operators: –
      If a holds value true and b hold value false.
    8. eclipse installation

    9. Assignment Operator: –
    10. Assignment Operator

      Example : This example shows how to use java operators in a class.

      Output :

  4. Hence, we successfully learnt how to install eclipse and execute your first program in java .


Please enter your comment!
Please enter your name here