Tutorial List
Home
Interview Questions
Interview
Interview Questions
Links
Web Home
About Us

Configure Eclipse

Being Java professional, we work with Eclipse most of the time. Eclipse is the id used by 90%(I guess) of Java professional. So this is really important how to configure Eclipse to start work. Well, by knowing this fact that most of you might be knowing how to configure Eclipse, I wrote this article for those who are coming from Netbean or some other IDE.
When you run Eclipse by double click or from run command, I ask for workspace. You can create workspace or can choose existing one, if any? You can consider workspace as your working folder. Once you choose workspace location, Eclipse IDS will open. Lets go step by step,

Configure Compiler:
Most of configuration part is done in menu Window->Preferences. when you click preferences, a  window opens. Here you can see lots of configuration stuff. Just click on Java->Compiler. Here which will open compiler configuration dialog.

Here you can set compiler level. The latest compiler these days is 6.0 however you can choose your own from drop down. Once done, click Apply to and your compiler is ready.


Configure JRE:
Now click on Installed Java->JRE. This will open a window which will ask you to locate JRE folder. Just browse to JRE folder and select JRE. This will list all the available jars in JRE. Now you can give a name to JRE using "JRE Name". Once done, click OK and JRE will be set.


Configure Server:
Now we will configure server. This is not much different from previous steps. A little blow to Java, Just click on Server to expand it. This will open three option, Select Install Runtime. This will open a window. There will a Add button on top right, click that and you will see a window like blow. Now select your server. For this tutorial, we will go for tomcat so click on Apache and select Tomcat v5.5 & click Next.

Now this will open another window(see pic. blow) where you need to specify your target JRE and tomcat home directory. Just locate tomcat home directory using Browse and select target JRE from Installed JRE list. If you have configured JRE and given a name to it, select your JRE else select workbench default JRE. Now click Finish and your Eclipse is configured. Enjoy working...

Wait a minute, Who will create Project then, This is the main thing we are looking for... :)


Create A Web Project:
When IDE is open, go to File->New->Project. This will open a window like this 

Click web from list of option. You can choose Dynamic web project. Some version of Eclipse also show Web Project. You can choose that too. This will initiate a project wizard hence a window like blow







Here you can give Project Name. All other field are set to default. You can over ride them if needed. Now click Finish or Next->Finish. Your project will be created and display in Project explorer.


Project Structure:
This is very important for Java developer for any programmer to know the correct project structure. If you miss it here, you might loose entire impression on your team...Well, no worries, Here we will discuss the project structure.
Just have a look at image blow,


I assumed this structure for struts type project. you can customize it according to your way. So we have src folder where our all the Java classes placed in some package. Try to maintain the same package structure as depicted in image. Now, keep all your java script, css and images under web-root folder.
Create a folder named jsp or pages (or any relevant) name you want, in web-inf to put jsp and html files. In web-inf, create another folder name tld and put all your tld in that. your configuration xml file will be at same location  as web.xml is.


I guess this was pretty easy to configure the eclipse. For any query, mail me at mohit.amour@gmail.com

Regards,
Mohit Singh

1 comment:

Anonymous said...

Awesome content..helped me a lot in configuring eclipse...Please add more on eclipse...