You are on page 1of 12

MyEclipse Mr.

SekharReddy

Q.) What is the Traditional style of application development?

-> Programmers had to edit files, save the files, run the compiler,
then the linker, build the application then run it through a debugger.

-> Today IDEs bring editor, compiler, linker and debugger into one
place along with project management tools to increase programmer
productivity. -> Programmers had to edit files, save the files, run the
compiler,
Q) What is IDE? what are the advantages of using an IDE?

-> Integrated Development Environment is a tool where set of


programs run from a single user interface.

->easy to use
->Rapid development
->easy to debug...etc.

Ex:- Eclipse, MyEclipse, NetBeans, Intelij, RAD, WSAD,


Jdeveloper...etc.

Q) What is workspace ?
-> It is a name space where we can store related projects.
-> We can choose the workspace during myeclipse startup.
-> We can change the workspace using

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 1
MyEclipse Mr. SekharReddy

(File-> Switch Workspace-> Others).

Q) What are different kinds of java projects we can develop in


myeclipse ?

java project => J2se


web project => jsp/servlet/struts/spring
ejb project => ejb
web service project => web service
Enterprise Application Project => ejb + servlets/jsp

Q) How to create java project?


file -> new -> java project=>enter project name

Q) Example of java project ?

Q) What is the package convention?

Inversedomainname.projectname.modulename.technology/usecase

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 2
MyEclipse Mr. SekharReddy

package convention
com.companyName.projectName.moduleName.useCase

Q.) How to get Content assist?

--> The content assistant allows you to get input help


in an editor. It can be invoked by CTRL + Space.

Q.) How to get Quick Fix ?

--> Whenever there is a problem in the code Eclipse will highlight


it as an error. Then Select error part and press (Ctrl+1)

-->Quick Fix is extremely powerful, it allows you to create new


local / instance variables, new methods, classes, put try and catch
around your exceptions, assign a statement to a variable etc.

Q.) how to Add external library (.jar ) to the Java classpath?

--> right click on project -> new -> folder -> "mylib"
--> copy and paste jar files into "mylib" folder.
--> right click on jar file-> Build path -> Add to Build path

or

--> right click on project -> Build path -> Configure Buildpath ->
libraries -> Add External jars -> Select required jar file.

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 3
MyEclipse Mr. SekharReddy

Q.) Add source code for jar ?

--> Open the Java Build Path page of a project (Projects > Properties >
Java Build Path). On the Libraries page expand the library's node
and select the Source attachment attribute and press Edit

Maintain the location to the source attachement.

Q.) Add the Javadoc for a jar

--> Download the javadoc of the jar and put it somewhere in your
filesystem.

--> Open the Java Build Path page of a project (Projects > Properties >
Java Build Path). On the Libraries page expand the library's node
and select the Javadoc location attribute and press Edit

Maintain the location to the api.

Important Preference Settings


-----------------------------

Window->Preferences -> java -> Editor -> Typing


Window -> Preferences -> java -> Editor -> Save Actions

=> You can export your Preferences settings from one workspace via
File -> Export -> General -> Preferences -> Give file name and location
File -> Import -> General -> Preferences -> select exiting preference file

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 4
MyEclipse Mr. SekharReddy

Similar you can import them again into your workspace.

Q.) How to import exiting project ?

File -> Import -> General -> Existing Project into workspace
->select the project folder -> ok -> finish.

Q.) What are the Code Templates ?

Window -> preferences -> java -> Editor -> Templates

If you have to type frequently the same code / part of the document you
can maintain templates which can be activate via auto complete (Ctrl +
Space).

For example lets assume you are frequently creating "public void name()
{}" methods. You could define a template which creates the method body
for you.

To create a template for this select the menu Window->Preferences and


Open Java -> Editor -> Templates

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 5
MyEclipse Mr. SekharReddy

Q) What is perspective?

-> A perspective is a visual container for a set of views and


editors.
-> We can change the perspective using Window->
Open Perspective -> Other.
-> Reset prespective "Window" -> "Reset Perspective".
-> Examples of perspectives
java, DB, debug, SVN Repository Exploring

Q) What is debugging?

--> Debugging is a tool used to identify coding errors at various


development stages.

Short cuts for debugging:


Next line : F6
Step into : F5
Step Out : F7
Next Break point : F8
Terminate : Ctrl + F2
Q) write a program to understand debugging?

different windows in debugging?

most commonly used short cuts


Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 6
MyEclipse Mr. SekharReddy

-----------------------------------------

Files / windows control

--> save : ctrl+s

--> save all : ctrl+shift+s

--> maximise / minimise window : ctrl + m

--> close a file in the window : ctrl + f4 / ctrl+w

--> close all files : ctrl + shift + w

--> how to change the file name :


right click -> refactor -> rename

-->How to change a variable name :


select variable + right click on variable
+ refactor + rename + give new name
+ press enter.
Code Editing

--> format code : ctrl+shift+f

--> organize imports : ctrl +shift + o

--> single line comment OR un comment : ctrl+ /

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 7
MyEclipse Mr. SekharReddy

--> multi line comment : ctrl+shift+/

--> multi line un comment : ctrl + shift + \

-->delete line : Ctrl + D

--> how to generate setters and getters :


-> right click -> source -> generate getters and setters

--> short form System.out.println :


syso+ ctrl + space

--> short form of public static void main :


main + ctrl + space
-->copy line ==> CTRL + ALT + Up/Down

Navigation :

--> Activate Editor ==> F12

--> Forward History ==> Alt + right arrow

--> Backward History ==> Alt + left arrow

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 8
MyEclipse Mr. SekharReddy
--> Next Perspective ==> Ctrl + F8

--> Next Window ==> Ctrl + F7

--> Quick View ==> Ctrl + E

--> Open Declaration ==> F3 or Graphically( ctrl+click on method )

--> Go to matching bracket ==> ctrl + shift + p

Others:

--> to see out line : ctrl + O

--> Open type : Ctrl + shift + T

--> Open Resource : Ctrl + Shift + R

--> search : Ctrl + H

--> Used on a method or class shows the whole inheritance tree, for example all methods which implement an interface.
==> ctrl + T

--> Run as Java application ==> Alt + Shift + X - J

--> How to add struts, hibernate, spring, ...etc capabilities?

Q.) What is the webapplication directory structure?

Web project development


Q.) How to create web project?

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 9
MyEclipse Mr. SekharReddy

File -> new -> Webproject > "Applicatin name"

Q.) What is the directory structure of web application ?

=> According to the sun microsystem there won't be any webroot in the directory structure. But
if we are creating the webproject in myelipse it will include Webroot in the directory structure
and it ill be removed while deploying the application into the server.

=> All the servlets should be there inside src and all the jsps should be there inside webroot or inside
web-inf.

=> We cannot access the wEB-inf jsp's directly.So in some projects we keep one jsp outside the WEB-INF and all
the remaining jsps we keep inside the WEB-INF.

=> All the generated .class files for the servlets should be there inside classes folder.

=> Eclipse automatically will move all the .class files to classes folder because the path is
configured automatically to check the path.

Default output folder => classes.

Q.) How to configure the tomcat with ide ?

Q.) How to deploy the tomcat with ide?

Q.) Develop and deploy web application in ide?

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 10
MyEclipse Mr. SekharReddy

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 11
MyEclipse Mr. SekharReddy

Naresh i Technologies, Opp. Satyam Theatre, Ameerpet, Hyderabad, Ph: 040-23746666, 23734842
An ISO 9001 : 2000 Certified Company
Page 12

You might also like