Wednesday, December 7, 2011

Eclipse

How to Load Javadocs / Java Source attachment for a specific jar (for example lucene-core):
In the project Explorer->select lucene-core*.jar -> right click and select properties -> select Javadoc location -> add lucene doc location folder to it. (Extract lucene doc jar from the distribution and provide the location)

How to load External Jars
Create / Open a class file -> Go to Project tab -> Properties -> (Search) java build path -> Click 'Add External Jars' -> select your jar and 'ok'

To see all shortcuts in Eclipse
Shift + Ctrl + l (L) - To open the preference page or to see all shortcuts
Alt + Shift + j - Add javadocs for methods or classes. Keep the cursor over method and press it.
ctrl + shift + r - Open Resource
ctrl + shift + c - comment a line of code / un-comment a line of code
ctrl + shift + g - Reference
ctrl + shift + d - To remove a single line
ctrl + shift + / (backslash) - comment a block (select a block you want to comment and use the shortcut key)
ctrl + shift + \ (forwardslash) - uncomment a block (select a block you want to comment and use the shortcut key)

http://codeofdoom.com/wordpress/2009/03/05/favorite-eclipse-shortcuts/
Alt+Shirt+R – rename refactoring
ctrl + shift + o (oh!) - Remove unwanted warnings
ctrl  + shift + f - Align the file.
ctrl + d = delete a line 

Line Numbers in Eclipse

To turn on line numbering in Eclipse, simply do the following;
1) Windows -> Preferences
2) General – > Editors -> Text Editors
and click the “Show Line Numbers” checkbox

How to modify project into DynamicwebProject, Java and JavaScript
Select the project folder -> right click go to properties -> select "Project Facets" -> select "Dynamic Web Module", "java", "JavaScript"

Need to add folder structure in Project
Select the project folder -> right click go to properties -> select "java build path" -> go to Source tab add Folder

Add Jars using Variable
Select Project (Folder - Folder with J, S, tag on it) -> properties -> java build path -> Libraries -> Add Variable -> select variable and click 'Extend...'. -> select the jar and ok.
If you need to add variables click 'Configure Variables...'

Required project on a build Path :

From 1 project if you need to load other projects classes, libraries from "java build path" "Projects" you can add projets. So, in 1 project DAO, DO you can call from other projects.

How to add Spring Capabilities to your Project :
Right click the project folder, and select Spring Tools -> Add Spring Project Nature, to add Spring capabilities to the web project. This feature will be available once you install the Spring IDE.

Extract a Jar file
jar -xvf .jar

Import images into Eclipse folder
Drag and drop the images into the eclipse folder you want.
eclipse.ini

-XX:MaxPermSize=512m
-Xms1024m
-Xmx2048m
-XX:-UseParallelGC 
-XX:+AggressiveOpts 
-XX:-UseConcMarkSweepGC 
-XX:+UseFastAccessorMethods

Install subversion plug-in on eclipse
In Eclipse -> Help -> Eclipse Market Place -> search "subclipse" and install.

No comments :

// Below script tag for SyntaxHighLighter