Eclipse IDE tutorial diagnosis and tips for the beginners

This assumes that you have gone through “Setting up Java, Maven, and Eclipse

#1. Creating the source folder like src/main/java, src/main/resource, etc via eclipse IDE

To create a new source folder under src/main/, right mouse click on project say “simple”.

eclipse-diagnosis-tut-1

eclipse-diagnosis-tut-2
click on finish.

Alternatively, you can highlight the project under which you want to create a “source folder” and then select “File –> New –> Source Folder” from the main menu or right click on the project to get the contextual menu, and then do “New –> Source Folder“.

eclipse-diagnosis-5

#2. Where are my class files created?

eclipse-diagnosis-tut-3

eclipse-diagnosis-tut-4-R

#3.How do I correlate to the underlying file system?

Right mouse click on the “Simple” project to get the “contextual menu” for the project. Then select “resource”

eclipse-diagnosis-tut-11

In the file system outside eclipse, you can see

eclipse-diagnosis-tut-4a

The pom.xml based Maven jar dependencies are under the libraries tab.

eclipse-diagnosis-tut-5

#4. How is Maven configured within eclipse?

1) You can check this on a global level via top main menu: Window –> Preferences

2) or on project level via project specific contextual menu: by right mouse clicking on the project and then select “properties”.

eclipse-diagnosis-tut-6

Also make sure that your eclipse installation has the Maven plugin m2e (Maven eclipse plugin).

eclipse-diagnosis-tut-7

#5. How do you check the compiler and JRE versions or change JRE?

Window –> Preferences

eclipse-diagnisis-tut-8

eclipse-diagnosis-tut-9

This is a global change. You can also do it at a project level by “right mouse clicking”, and then selecting “Properties –> Java Compiler“. For JRE, “Properties –> Java Build Path –> Libraries (tab) –> Select the JRE –> Edit (button) –> change the JRE for this project”

#6. How to run a Java file with the main method?

Select the Java source file to run, right mouse click, and from the contextual menu select “Run As” –> “Java Application

eclipse-diagnosis-tut-10

#7. How to inspect Eclipse IDE JVM version and JVM args like memory, etc?

Go to your file system where Eclipse is installed (e.g. C:\TOOLS\eclipse\eclipse-4.3), and open the “eclipse.ini” file


800+ Java Interview Q&As Menu

Learn by categories on the go...
Learn by categories such as FAQs – Core Java, Key Area – Low Latency, Core Java – Java 8, JEE – Microservices, Big Data – NoSQL, Architecture – Distributed, Big Data – Spark, etc. Some posts belong to multiple categories.
Top