===== Eclipse IDE =====
==== Run configuration ====
**Menu > Run > Run Configurations** \\
Details are [[http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/launchers/configuration.htm | here]].
{{http://i.imgur.com/a5Osr.png}}
^ Concept ^ Tab ^ Explanation ^
| Workspace Data | Main Tab \\ {{http://i.imgur.com/imlij.png?300}} | Runtime preferences for the Eclipse Application ([[http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/launchers/configuration.htm|Details]]): \\ -Dialog sizes \\ -Dialog positions |
| Launch configurations| Configuration Tab \\ {{http://i.imgur.com/54bhq.png?300}} | Things about imports ([[http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/launchers/configuration.htm|Details]]): \\ -Everything about imported Bundles in the config.ini \\ -Path to SplashScreen \\ -Path to the target \\ -Text-Cache by OSGI \\ -execution-arguments \\ (Can be exported into a *.launch file inside of the Comon-Tab. \\ Exported configurations can't be overridden by Eclipse (e.g. by clicking "Launch as Eclipse plugin" )) \\ |
|Java and Project execution-arguments| Arguments Tab \\ {{http://i.imgur.com/RM8vp.png?300}} | A part of Configurations. Can be exported together with configurations. |
==== Path Variables ====
The [[http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fconcepts-exttools.htm|Path Variables]] are used to point to important Eclipse Folders.
E.g. to point to a imported Eclipse project - use the syntax:
^Var ^Path^
|${project_loc:de.ivu.fare.rcp.product}/ |c:\eclipse\workspace\de.ivu.fare.rcp.product\||
|${workspace_loc} |c:\eclipse\workspace|
|${workspace_loc:/MyProject1/MyFile.txt}|c:\eclipse\workspace\MyProject\MyFile.txt|
|${workspace_loc:/MyProject2/MyFile.txt}|c:\projects\MyProject2\MyFile.txt|
|${project_loc} |c:\projects\MyProject2|
|${project_loc:/MyProject1/MyFile.txt} |c:\eclipse\workspace\MyProject|
|${container_loc} |c:\projects\MyProject2\MyFolder|
|${resource_loc} |c:\projects\MyProject2\MyFile.txt|
|${project_path} |/MyProject2|
|${container_path} |/MyProject2/MyFolder|
|${resource_path} |/MyProject2/MyFolder/MyFile.txt|
|${project_name} |MyProject2|
|${container_name} |MyFolder|
|${resource_name} |MyFile.txt|
|${build_type} |none|
After the ":" there is the name of the project as a parameter, as documented [[http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Fconcepts%2Fconcepts-exttools.htm|here]]
ACHTUNG: when using this Variables for JavaVirtualMachine Parameter - no empty spaces are allowed!
How to inspect the eclipse path-variables:
* Use **Run > External Tools > External Tools Configurations**
* Add **C:\Windows\System32\cmd.exe** as external Tool and the Path-Variable e.g. **${project_loc}** as working directory.
* Run and see in console which path was used
{{http://i520.photobucket.com/albums/w327/schajtan/2013-12-03_14-33-08_zpse1f9f4f7.png}}
==== Exclude packages from organize imports ====
To exclude packages from automatic import functinality add it here:
{{http://i.imgur.com/UkajPzF.png}}
==== Shortcuts ====
^ShortCut ^Describtion^
|STRG + Alt + H (cursor in Method or Class)| Shows the Call hierarchy. Bottom Up. \\ Shows endless path from current class / method to the callers, to the callers of callers... |
|STRG + Shift + G (cursor in Method or Class)| Shows where the current class/method was used. Restricted to the forst caller level and to workspace. |
==== Subversive uninstall ====
The only way to delete this fucking peace of shit is by deleting jars:
org.eclipse.team.svn.core_0.7.5.I20081029-1900.jar
org.eclipse.team.svn.help_0.7.5.I20081029-1900.jar
org.eclipse.team.svn.resource.ignore.rules.jdt_0.7.5.I20081029-1900.jar
org.eclipse.team.svn.ui_0.7.5.I20081029-1900.jar
org.eclipse.team.svn_0.7.5.I20081029-1900.jar
org.polarion.eclipse.team.svn.connector.javahl15_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector.javahl_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector.svnkit15_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector.svnkit_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector_2.0.5.I20081024-1200.jar
==== Static builder ====
The static builder are **Eclipse project specific**.
The static Builders are responsible for static code analysis, as described [[http://stackoverflow.com/questions/6517297/please-explain-which-eclipse-builders-are-actually-needed-and-how-to-fix-slow-bl | here]]
* Maven
* Warnings
* API deprecation
* Checkstyle...
{{http://i.imgur.com/eXHuEa7.png?400}}
==== Define own templates ====
You can use variables to position the cursor, to retrieve the package or class!
Then a static Logger can be retrieved by one line, incl. package names and imports!
A good usage example is:
private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(${enclosing_type}.class);
Own Templates can be defined by using Editor Templates:
{{http://i520.photobucket.com/albums/w327/schajtan/2013-04-29_16-05-00_zpsc0fb0a3b.png?500 }}
After that you will be able to do actions, which you do frequently, by typing ALT + and choosing it from the list.
{{http://i520.photobucket.com/albums/w327/schajtan/2013-04-29_16-08-40_zpsc71daca4.png?500 }}
==== Eclipse Metafiles ====
== .project ==
Describes the project Data, like Name etc.
common-sales
org.eclipse.jdt.core.javabuilder
net.sf.eclipsecs.core.CheckstyleBuilder
org.eclipse.m2e.core.maven2Builder
org.eclipse.jdt.core.javanature
org.eclipse.m2e.core.maven2Nature
net.sf.eclipsecs.core.CheckstyleNature
== .classpath ==
==== Eclipse Maven Tycho Plugin ====
This Plugin allows automatic reading of maven configuration files (pom.xml), \\
extracting dependencies from these files, \\
importing them as Eclipse dependencies!
== Resolution of Dependencies in Workspace ==
Maven can look for open Projects in Workspace and resolve Project resolutions by using open Porjects from workspace.
RightClick on Project > Maven > Enable Workspace Resolution
== Offline build ==
If you wanna run a job, \\
so that the build only depends on artefacts in LOCAL REPOSITORY \\ (Maven should not download stuff from remote repository, maybe because you are developing something locally and did not check in changes yet. So you build a project part and put it into you local repo. And another project part depends on it, so you only rebuild this part. So Maven should use artifacts from local repository, which were changed earlier but not checked in! )
Todo that - check the offline checkbox in the matching **runtime configurations**!
{{http://i520.photobucket.com/albums/w327/schajtan/2014-01-14_15-18-22_zpse42adfd8.png}}
==== Static code analyzer ====
There are:
* Checkstyle - http://eclipse-cs.sf.net/update/
* PMD - http://pmd.sourceforge.net/eclipse/
* FindBugs - http://findbugs.cs.umd.edu/eclipse/
== CheckStyle ==
Fast applying correcting the checkstyle rules is able by doing following on the Error. RightClick on the Error > Quick Fix
**DOES NOT WORK IN KEPLER:** Mass Checkstyle QuickFixes: RightClick on the Java file > Apply Checkstyle Fixes
{{http://i520.photobucket.com/albums/w327/schajtan/2013-11-06_10-36-16_zpse63221c0.png}}
{{http://i520.photobucket.com/albums/w327/schajtan/2013-11-06_11-18-44_zps793b96c1.png}}
==== Debugging Source lookup ====
The Debugging Source lookup should always be a Project, if possible. (Not a Jar, not a Folder) \\
This enalbes setting breakpoints, inspecting variables etc.
To change the existing Debugging Source change to the Debugeer perspective, rightclick on the current class in debugger:
{{http://i520.photobucket.com/albums/w327/schajtan/2013-12-10_13-29-43_zpsec294327.png}}
==== GC overhead limit exceeded ====
Let Eclipse use more memory, so that it does not regulary get "memory exceed" errors..
- Open **eclipse.ini**
- Replace numers 256 by 1024 or even 2048
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130807-1835
-product
org.eclipse.epp.package.rcp.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
2048M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
2048m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
d:/Development/Java/jdk1.7.0_15/bin/javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
==== Pointing to a specific JDK ====
-vm
d:/Development/Java/jdk1.7.0_15/bin/javaw.exe
==== M2E ====
Ein Plugin welches viele Maven Befehle in Eclipse einbaut.
Um aktualisierte Maven-Artefakte wieder via Maven Repository zu beziehen macht man:
maven > maven Update project
{{http://i520.photobucket.com/albums/w327/schajtan/2014-12-02_17-30-51_zps8db02597.png?500}}
Alternativ kann man dasselbe auch via Console machen. Generiert .project und .pref Dateien.
http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
mvn eclipse:eclipse
==== IDE Plugins ====
|Grep Console|coloring in console| https://marketplace.eclipse.org/content/grep-console |
|ObjectAid UML Explorer| UML generation from code| https://marketplace.eclipse.org/content/objectaid-uml-explorer |
| Eclipse Tooling | All Spies and E4 Tools |
- https://marketplace.eclipse.org/content/eclipse-4-tools-lightweight-css-editor
- https://marketplace.eclipse.org/content/eclipse-4-tools-css-spy
- https://marketplace.eclipse.org/content/eclipse-4-tools-application-model-editor
- https://marketplace.eclipse.org/content/eclipse-4-tools-context-spy
- https://marketplace.eclipse.org/content/eclipse-4-tools-event-spy
|
|Jspresso Colors 'n Fonts| Tool to visualize Colors / Fonts directly in Eclipse|http://marketplace.eclipse.org/content/jspresso-colors-n-fonts#.Ugnf0tJkP4g|
|PDE Visualization Plugin| adds Graph Plug-in Dependencies View | https://marketplace.eclipse.org/content/pde-incubator-dependency-visualization|
|Properties Editor|Properties Editor which can visualize escaped chars and unicode chars|https://marketplace.eclipse.org/content/properties-editor|
==== out-of-sync with filessystem problems ====
To make Eclipse sync automatically with files system - let it poll the folders automatically
Windows > Preferences > General > Refresh using native hooks or polling
{{http://cdn.javabeat.net/wp-content/uploads/2013/11/eclipse-refresh.png}}