Table of Contents
Eclipse IDE
Run configuration
Menu > Run > Run Configurations
Details are here.
Concept | Tab | Explanation |
---|---|---|
Workspace Data | Main Tab ![]() | Runtime preferences for the Eclipse Application (Details): -Dialog sizes -Dialog positions |
Launch configurations | Configuration Tab ![]() | Things about imports (Details): -Everything about imported Bundles in the config.ini -Path to SplashScreen -Path to the target -Text-Cache by OSGI -execution-arguments <fc #C0C0C0>(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” ))</fc> |
Java and Project execution-arguments | Arguments Tab ![]() | A part of Configurations. Can be exported together with configurations. |
Path Variables
The 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 here
<fc #FF0000>ACHTUNG: when using this Variables for JavaVirtualMachine Parameter - no empty spaces are allowed!</fc>
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
Exclude packages from organize imports
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 here
- Maven
- Warnings
- API deprecation
- Checkstyle…
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:
After that you will be able to do actions, which you do frequently, by typing ALT + <SPACE> and choosing it from the list.
Eclipse Metafiles
.project
Describes the project Data, like Name etc.
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>common-sales</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>net.sf.eclipsecs.core.CheckstyleBuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>net.sf.eclipsecs.core.CheckstyleNature</nature> </natures> </projectDescription>
.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!
Static code analyzer
There are:
- Checkstyle - http://eclipse-cs.sf.net/update/
- 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
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:
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
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 | |
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 |