Most Commonly asked Eclipse Interview Questions and Answers:
Eclipse platform provides the foundation for Eclipse IDE
If you are preparing for an Eclipse interview, then these are the top 30 most frequently asked Eclipse Interview Questions and Answers that you need to know. We have designed them to get you introduced to the questions you tend to be questioned during your technical interview.
Have a thorough look!!
This article on Eclipse Interview Questions and Answers will enrich your knowledge on all the Eclipse concepts with pictorial representation to enable you to understand them in a better way and clear any interview confidently.
An Integrated Development Environment (IDE) is an application providing environment for Software Development. An IDE will have Code Editors, Debuggers, Logging tools, Version Control System etc. ‘NetBeans’, ‘Eclipse’ are examples of such IDEs.
In the late 90s, there were several tools that were available for Java development in the market, but integration between these tools was not so easy and smooth.
With the introduction of Eclipse IDE, integration between the components became smooth and much easier too. Thus Eclipse became one of the most popular IDE's in Java development.
List of most Frequently Asked Eclipse Interview Questions
Given below is a list of most important and commonly asked Eclipse interview questions that would help any job seeker.
Q #1) What is an Eclipse IDE?
Answer: Eclipse IDE is the most widely used Java development environment. It is also used to develop the applications in other programming languages like python, c#, c++ etc.
Q #2) What are the System Requirements for Eclipse IDE to run successfully on our computer system?
Answer: A system must have the latest version of the Java run time properly installed, for Eclipse IDE to run successfully in it. You can install either ‘JRE’ or ‘JDK’ depending on the task you need to perform with Eclipse IDE.
To check if our system has Java Runtime Environment installed in it or not-
Use command prompt and type in the command ”Java -version'. (Please refer Fig: Ques No 2).
Fig: Ques No 2
(Please note that: I have installed Java JDK file on my system).
Q #3) What is the latest version of Eclipse IDE that is released?
Answer: Eclipse oxygen 64-bit is the latest version of Eclipse IDE. It was released on 28 June 2017.
Q #4) What are the names of the different versions of Eclipse IDE?
|Eclipse Version Name||Version Number|
|Juno||3.8 and 4.2|
Q #5) What are the types of files likely to be found in ‘SRC' and ‘Bin' folder, of your java project developed using Eclipse IDE?
Answer: If you have developed a Java project using Eclipse IDE and added codes to meet the project requirements, then you can find ‘.java' files in the ‘src' folder and corresponding ‘.class' files in the ‘bin’ folder. (When we run a Java Project; ‘.java' files are compiled to ‘.class' files).
Q #6) What are the Operating Systems that support Eclipse IDE?
Answer: Eclipse IDE is a cross-platform, hence it can be successfully installed and used as a development environment in almost all the operating systems like Windows, Mac, Linux, Solaris etc.
Q #7) How to create the documentation of a project using Eclipse IDE?
Answer: If we need to generate documentation for a project using Eclipse IDE, select ‘Project’ in a menu item and then select ‘Generate Javadoc’.
Then, we need to add a library (javac.jar) file to the project and specify a location in the system where we needed to save the document generated. (Please refer Fig: Ques No 7 and Fig: Ques No 7a)
Fig: Ques No 7
Fig: Ques No 7a
After generating the documentation of the project, you will get a new folder in the project explorer named as ‘doc’. Open ‘index.HTML’ within the ‘doc’ Folder and there we can find the project documentation. (Please refer Fig: Ques No7b)
Fig: Ques No 7b
Q #8) Why is it always better to ‘Close’ a Project in Eclipse IDE than leave it ‘Open’ in the Package Explorer?
Answer: In an Eclipse IDE, we can have a number of projects in the ‘Package Explorer’. Those projects can be either in ‘Open’ or ‘Closed’ state.
An ‘Open’ projects will consume a lot of memory. Also ‘Open’ projects take up build time especially when we try to ‘Clean’ the projects in the workspace. So it is always better to ‘Close’ a project.
Q #9) If you need to ‘Reset’ a particular perspective in Eclipse IDE, how will you attain it?
Answer: The common name given to the default arrangement of views and editor area in the development environment is called a ‘perspective’ in Eclipse IDE.
To ‘Reset’ a particular perspective in Eclipse IDE:
- Select the ‘perspective’ Icon (Please refer Fig: Ques No 9), usually shown on the top right corner of eclipse IDE.
- Right-click on the icon.
- Select the ‘Reset’, thus we can reset the views in perspective.
Fig: Ques No 9
‘Reset’ action will put all the windows back in a position where they are supposed to be, by default.
Q #10) Explain how to add a jar file to the project build path in Eclipse IDE?
Answer: For adding a utility ‘jar’ file to the project created in Eclipse IDE. (Please refer Fig: Ques No 10)
- Select the ‘project’.
- Right-click the project.
- Select ‘properties’.
- Select ‘Java build path’.
- Select ‘libraries’ tab.
- Select ‘add external jar file’.
- Find the location of the ‘jar’ file in your system and add the same to the project.
After this, we can use the functionalities and features related to the jar file in the project.
Fig: Ques No 10
Q #11) What are the tasks that you can accomplish with Eclipse IDE?
Answer: The tasks that can be accomplished are stated below:
- We can create a generic project using Eclipse IDE. A Generic project is a set of guidelines, tricks, rules, task, and tips that help you to create the product and market your product, in a faster and efficient way.
- Edit files in the generic text editor.
- Share files using CVS (concurrent version system) server.
Q #12) What is Eclipse IDE modelling framework?
Answer: While creating a project using some IDE we may add ‘class’ files, create a model for the project and create XML schema for the same. If we have a better modeling framework, we need to create only one of these entities and rest of them will get created along. This is done by EMF (Eclipse Modelling Framework).
So EMF is a set of Eclipse plug-ins, which can be used to model a data model and to generate code from it. An eclipse modeling framework is a Java /XML framework.
Q #13) How to generate code automatically with the Eclipse IDE?
Answer: Consider the Example, you have a class file and some attributes inside the class.
You need to generate ‘get’ methods and ‘set’ methods for the value of an attribute in the class. We can use the ‘Generate Getters and Setters’ feature of Eclipse. Eclipse IDE can automatically generate getters and setters methods for the attributes.(Refer Fig: Ques No 13)
Fig: Ques No 13
Q #14) Explain about ‘Builders’ associated with the projects in Eclipse IDE?
Answer: Projects created in Eclipse IDE have zero or more ‘builders’ associated with it. A builder is responsible for compiling the source code and generating classes for the associated project. A java project is associated with a java builder.
To find the builders associated with a project:
- Select the ‘Project’.
- Right-click on the ‘Project’ in the Package Explorer.
- Select ‘Properties’.
- A window named as ‘Properties for sample’ is shown, in the left-hand side tree check for ‘Builders’ and select it. (Please refer the Fig Ques No 14).
Fig: Ques No 14
Q #15) What is Rich Client Platform?
Answer: A minimal set of plugins that you need to build a rich client application is known as the Rich Client Platform.
Creating a sample application Eclipse IDE need only two plugins like ‘org.eclipse.ui’ and ‘org.eclipse.core.runtime’.
Q #16) What is Workspace?
Answer: Workspace is the actual location of a project developed using Eclipse IDE. It contains source files, images and other artifacts like preference settings, plug-in, specific metadata, logs etc.
To change the workspace location:
- Click ‘File’ in the menuBar.
- Select the ‘stitch Workspace’.
- Select a new location to create/open a new project. (Please refer Fig: Ques No 16)
Fig: Ques No 16
Q #17) How to install a new plug-in and run it at the start of Eclipse IDE?
Answer: We can install third-party plug-ins in Eclipse IDE using ‘Help’ –> ‘install software’. (Please refer the Fig: Ques No 17)
Fig: Ques No 17
Usually, a plug-in has two parts, a declarative part, and a code part. The declarative part is in a plugin.XML and is loaded when the platform starts running and is available regardless of whether a plug-in has started.
When the user starts coding, the plugins functionality is explicitly invoked by the user.
Q #18) How is Refactoring done in Eclipse IDE?
Answer: Re-factoring is the method of reconstructing the code without behavior changes. One of the examples of refactoring is ‘rename’ a class or a method. If you need to change the name of a class or method, you can right-click on your class and select ‘rename’ and then we can type in the desired name.
Eclipse IDE will make sure that the name is changed everywhere without any further effort.
Q #19) Where can we find the log file in Eclipse IDE?
Answer: When a problem encounters, we will have the reports of them documented in the workspace log file. Location, where the log file stored, is in workspace/.metadata/.log. In Eclipse IDE error log view will show all the captured errors.
In Eclipse IDE error log is available under Windows -> Show view -> Error log. (Please refer Fig: Ques No 19)
Fig: Ques No 19
Q #20) While a User is running the Eclipse IDE, following error occurred? Error: “Java runtime environment (JRE) or Java development kit (JDK) must be available in order to run eclipse”. (Please refer Fig: Ques No 20)
Fig: Ques No 20
How to solve the issue?
Answer: If the issue raises, we must verify that we have added the java location in ‘environment variables’ for the system properties correctly.
In order to verify if ‘environment variables’ has been added to System Property correctly:
- Select ‘My computer’.
- Select ‘properties’.
- Select ‘advance system settings’.
- Select ‘advance’ tab.
- Select ‘environment variable’.
- Click ‘new’ button under user variable and enter a variable name as ‘path'.
- Copy the location of Java bin and paste it in the starting of the variable value and Click ‘ok’.
- After completing the process, run the Eclipse IDE.(Refer Fig: Ques No 20b).
Fig: Ques No 20b
Q #21) How to format the codes in Eclipse IDE?
Answer: Control+Shift+F is the shortcut for formatting statements. But if we want to format the entire project, use ‘autoformat’ functionality IDE. (Refer Fig: Ques No: 21)
Fig: Ques No 21
- Select “Windows”.
- Select “Preferences”.
- Then Type in “Format “(as shown in Fig: Ques No 21).
- Then search for “Java -Code Style –formatter”. Here we will have a default format style. We can change it by edit option. (Refer Fig: Ques No 21b).
Fig: Ques No 21b
For Example, ‘braces’.
We can put ‘braces’ on the same line or the next line according to our convenience and the coding standards that are chosen. You can configure all types of formatting here. If you are working on a team project, you can export the preferences of format and share it with the other members of the team.
Q #22) What is Hot Code Replace?
Answer: ‘Hot Code Replace’ is a debugging technique, which means it is possible to alter the codes in Java files (if needed) while debugging the codes on a run-time workbench. For Eclipse IDE, restarting is not required to accomplish the task.
The debugger will replace the code in the Virtual Machine while it is running.
Q #23) How can you run an eclipse IDE in a clean mode?
Answer: If you install a new plugin or remove the unused plugins from Eclipse IDE, then it is recommended to run the development environment in a clean mode. The process will clear all the cached information and will not affect any workspace related data.
To run an eclipse IDE in clean mode there are two methods:
#1) Start the IDE using the command line in cmd prompt ‘eclipse -clean' (Refer Fig: Ques No 23).
Fig: Ques No 23
#2) Edit the eclipse.ini file by inserting the line ‘-clean’ as the first line in the file. Make sure to remove the same line from ini file, as it causes Eclipse to re-evaluate all of the plugins every time it starts up and increases the startup time.
Q #24) If Eclipse IDE throws an error, ‘Missing R.java file’, how can we solve the issue?
Answer: The R.java file is an auto-generated file which contains references to all the resources used in a project.
Possible fixes for the above-said error is:
- Make sure that in ‘Eclipse IDE ‘–in menu item ‘Project’ -> “Build automatically” is checked.
- Then ‘Clean’ your project and ‘Build’ it again.
- Make sure that there are no errors in your xml files.
Q #25) Explain the Debug Configuration in Eclipse IDE?
Answer: User can change the ‘Debug Configuration ‘for a Java project created using Eclipse IDE.
To change the ‘Debug Configuration’:
- Select ‘Run’ menu item.
- Select “Debug Configurations”.
- Select the “Java Application” from the list on the left-hand side (if we need to create debug configuration for Java application) and click on the New button. A dialog box comes up.(Refer Fig: Ques No 25).
Fig: Ques No 25
Q #26) Describe few frequently used shortcuts that are used in Eclipse IDE.
#1) Press Ctrl + Shift + L, it will open a widget that shows all the shortcut keys (Refer Fig: Ques No 26)
Fig: Ques No 26
#2) In Java editor press Ctrl + space to see the list of suggested auto-completion available in Eclipse IDE (Refer Fig: Ques No 26b)
Fig: Ques No 26b
#3) When the cursor is positioned inside the method argument in a class, then press Ctrl + Shift + Space in a keyboard to see a list of suggested parameter. (Refer Fig: Ques No 26c)
Fig: Ques No 26c
#4) Type ‘/**' and press Enter the key. It will automatically be added to the commands that we can include in the Javadoc document. (Refer Fig: Ques No 26d)
Fig: Ques No 26d
Q #27) What are the views of an Eclipse IDE Workbench?
Answer: The major visible parts of an Eclipse IDE are:
- Editors (all appear in one editor area)
- Menu Bar
Q #28) Name the Menu items that are available on the Menu Bar of an Eclipse IDE.
Answer: Menu items shown on the Menu Bar of IDE depend on the installed plug-ins in the Eclipse IDE. Customization of the Menu items can also be done using the Customize Perspective dialog box to show the desired menu items.
Fig: Ques No 28
- File menu
- Edit menu
- Source menu
- Refactor menu
- Diagram menu
- Navigate menu
- Search menu
- Project menu
- Run menu
- Window menu
- Help menu
Q #29) If you encounter the following error while launching the Eclipse IDE, What will you do to fix the Issue?
Fig: Ques No 29a
Errors: “could not create a Java virtual machine. A fatal exception has occurred. The program will exit”. Explain?
Answer: Error you have encountered now is an ‘Exit’ error. To fix this issue, we need to add the ‘Virtual Machine Path’ in the ‘eclipse.ini’ file.
Fig: Ques No 29b
Open eclipse.ini file and make sure that you add the path before, vmargs (Just like shown in the Fig: Ques No 29b). Save the eclipse.ini file and try to launch Eclipse IDE again.
Q #30) How can we know the details about plug-ins that have been installed in Eclipse IDE?
Answer: Eclipse is considered to be an extensible IDE as we can install several plug-ins in the IDE which in turn makes it so popular for development purpose.
To know the details about the list of plug-ins installed in Eclipse IDE:
- Select ‘Help'
- Select ‘About Eclipse’
In the ‘About Eclipse’ Window, we can find all the “Installation Details” of it (Please refer Fig: Ques No 30a).
Fig: Ques No 30a
If we click on the ‘Installation Details’, we can see the details of all the plug-ins installed in IDE (Please refer Fig: Ques No 30b).
Fig: Ques No 30b
Eclipse IDE is composed of many plug-ins and it can be extended further using additional plug-ins as well. Java Development Tool (JDT) provides a plug-in that allows it to be used as an IDE for Java development.
Similarly, PyDev is a plugin that allows Eclipse to be used as a Python IDE and C/C++ Development Tools (CDT) is a plug-in that allows Eclipse to be used for developing an application using C/C++.
Eclipse can be used as an IDE for any programming language for which a plug-in is available.
If you have a thorough knowledge of the above-given Eclipse Interview Questions, then you can clear any interview successfully. I hope my efforts in preparing this will help any job seeker.
Every Interview is much important..!! Happy Job Hunting!