Java Editor Breadcrumb |
The Java editor now offers a breadcrumb which shows the path to the element at the cursor position. The breadcrumb can be enabled via the Toggle Breadcrumb tool bar button or by pressing Alt+Shift+B: Each element in the breadcrumb can be selected and actions can be invoked through a context menu or keyboard short cuts.
Furthermore the breadcrumb lets you navigate to other elements via drop-downs.
|
Rich Javadoc Hover |
The Javadoc hover can now be used to navigate Javadoc.
The hover also shows the icon corresponding to the current Java element To enrich a hover either press F2 or move the mouse into the hover. You can configure how to enrich the hover on the General > Editors > Text Editors preference page. |
Rich Java problem hover |
The problem hover now offers all available quick fixes for a problem and shows a tool bar on F2 or when you move the mouse into it. Quick fixes can be executed by clicking on the links. The actions in the tool bar let you configure the annotation preferences and the problem severity. |
Content assist improvements |
Content Assist (Ctrl+Space) has been improved in several areas.
|
Quick assists |
New quick assists (Ctrl+1) have been added in this release:
|
SWT Templates |
A set of templates have been added to provide code building blocks for SWT widgets. To add, for example, an SWT button, type Button and press Ctrl+Space, select the Button SWT template, and press Enter.
To see all available templates go to the Java > Editor > Templates preference page or open the Templates view through Window > Show View > Other.... |
New Template Variables |
New template variables have been added and existing variables have been improved. Consult the Template Variables help page for a detailed overview. |
Specify location for templates |
It is now possible to specify the location where Java editor templates are applicable.
As a result, Content Assist (Ctrl+Space) will only show templates applicable at the current location. |
Format edited lines on save |
A new save action allows to format the edited lines on save. With this option enabled, format on save generates a minimal amount of changes, even on unformatted code. To enable this feature go to the Java > Editor > Save Actions preference page and select Format edited lines. |
'Fix Project Setup' quick fix |
If a type can not be resolved a new quick fix offers to fix the class path: For normal Java projects, the quick fix will search in other projects for the type and offer to add the JAR that contains that type to the build path. For PDE projects, information from the plug-in manifest is used to offer a new plugin dependency. Other project types can add their fix proposal through a new extension point. |
Highlighting numbers in Java code |
The Java editor can now show numbers with their own custom color.
The color can be configured on the Java > Editor > Syntax Coloring preference page. |
Javadoc shows constant value |
The Javadoc hover and the Javadoc view now show the constant value of static fields. |
Mark read and write occurrences |
Mark Occurrences (Alt+Shift+O) now marks read and write accesses with different colors. Mark Occurrences can be enabled in the tool bar. Annotation colors are configured on the General > Editors > Text Editors > Annotations preference page |
Occurrences in File improvements |
Several improvements have been added to Search > Occurrences in File:
|
Extract Class refactoring |
Extract Class replaces a set of fields with a new container object. All references to the fields are updated to access the new container object. This refactoring helps to group fields which logically belong together. The following example demonstrates how to extract the fields x,y,z to a new class Position: The refactoring results in the creation of a new To execute the Extract Class refactoring, select a type and invoke Refactor > Extract Class. |
New Clean Ups |
The following Clean Ups have been added:
Add unimplemented methods is most useful after adding a new method to an interface. Correct indentation is also available as save action. To clean up your code select a set of Java elements and invoke Source > Clean Up. |
Refactoring flags references in binaries |
Refactorings now flag references to the refactored element inside compiled class files. Such references cannot be updated and would lead to problems at run time. |
Undo format |
Formatting a set of Java elements, e.g. via Package Explorer, can now be undone using Edit > Undo Format (Ctrl+Z). |
Annotation formatting improvements |
The Java source code formatter now provides fine-grained options for line breaks after annotations. It is possible to specify for each type of annotation if it should be followed by a line break:
This can be configured on the Java > Code Style > Formatter preference page.
|
Java compiler on multi-CPU machines |
The Eclipse Compiler for Java is now taking advantage of the multi-threading capability of multi-CPU machines. Our measurements show improvements up to 30%. Results depend on the JRE and platform used. |
Support for external class folders |
Class folders located outside the workspace (external) can now be added to the build path. To add an external class folder use the Java Build Path page of the project properties, select the Libraries tab and push the Add External Class Folder button. |
New and improved compiler diagnostics |
Several improvements have been made to the problem detection in the compiler:
You can configure this settings on the Java > Compiler > Errors/Warnings preference page. |
CLDC 1.1 class file compatibility |
The Java compiler can now create CLDC 1.1 compatible class files. You can set this on the Java > Compiler preference page: |
Flexible ZIP archive extensions |
It is now possible to add ZIP archives to the build path with file
extensions other than It is now, for example, possible to add a |
JUnit view shows execution time |
The JUnit view now shows the elapsed time for test cases and test suites. |
Improved Javadoc view |
The Javadoc view has been improved with:
|
Rearrange content of files per drag and drop |
Unsorted views like the Outline view and the Members view in the Java browsing perspective can now be used to rearrange members by drag and drop. |
Call Hierarchy view works with fields and types |
The Call Hierarchy view in caller mode now works with more kinds of elements:
|
Runnable JAR export wizard |
The Runnable JAR File Export wizard can create a JAR file based on a launch configuration. The generated JAR file contains all class files from the project including class files from required JARs and projects. The generated JAR can be executed with the command:
or, on most operating systems, by double-clicking the file.
The export wizard can also create an ANT script which can be used to build the JAR. Invoke File > Export... and then select the Java > Runnable JAR file wizard to create such a JAR file. |
More Java search options |
Type reference search can now be limited to specific match locations in the code. For example, you can find references in cast expressions, or in field and local variable types. The following example shows how to search for all catch clauses in your code (search for references to '*' and limit to catch clauses):
|
Paste creates snippet for members and statements |
Paste (Ctrl+V) in the Package Explorer view now supports members and statements. Eclipse creates the required enclosing elements for you. For example, pasting: List<Number> numbers; numbers= Arrays.asList(1, 2, 42); into _pasted_code_ generates a Java class and main method to hold the statements: |
Enhanced debug hover |
When debugging, hovers for variables have been enhanced to display an object inspector. The inspector will display logical structures according to the toggle setting in the visible Variables or Expressions view. |
Execution environment description files |
An execution environment description file describes a JVM and the environment it represents (see Execution Environment Descriptions for detailed information on the file format). The file defines JVM properties such as boot path, endorsed directories, language level, executables, source attachments, and so on. You can now add JREs to your workspace using execution environment description files from the Installed JREs preference page. Press Add and select the Execution Environment Description JRE type. On the following page specify an .ee file. This will create a JRE with attributes from the description file. This example shows J9 configured for Foundation 1.1. |
Search for installed JREs on Mac |
You can now search for all installed JREs on Mac. Pressing the Search button on the Java > Installed JREs preference page will add definitions for all VMs installed in the operating system's default location ( |
Search results include launch configurations |
Launch configurations now appear when searching for references to a main type. Double-clicking on the search result opens the launch dialog on that configuration. |
Wait for remote debug connection |
A socket listening connector has been added to the Remote Java Application launch type. This allows you to start the Java debugger listening for connection on a specific socket. The program being debugged can then be started with command line options to connect back to the debugger. Select "Standard (Socket Listen)" in the connection type drop down. |
Default watchpoint suspend settings |
You can now control the suspend settings for newly created watchpoints. A watchpoint can suspend execution when a field is accessed, modified, or both. The new preference is available on the Java > Debug preference page. |