blob: c94b8b68e576ce96eecfcd53cb4d2ea8da2e8613 [file] [log] [blame]
= Java(R) development tools
== Java(R) 9
http://docs.oracle.com/javase/9/[Java(R) 9] is here, and Eclipse JDT fully supports it:
* The Eclipse compiler for Java (ECJ) implements all the new Java 9 http://docs.oracle.com/javase/9/docs/technotes/guides/language/enhancements.html[language enhancements]
* Updated significant features to support Java Modules, such as compiler, search and many editor features.
*Note:* It is not mandatory to run Eclipse with Java Runtime 9 to get the Java 9 support. However, a Java runtime 9 is required to be on a project's build path to compile a modular project against the system modules.
* When a Java Runtime 9 is added to a project's build path, the system modules are listed under the System library in the package explorer:
image::images/java9-package-explorer.png[]
* An existing non-modular Java project can be quickly converted to a module by creating a module-info.java for that project. This feature can be availed once the project has been moved to compliance 9:
image::images/java9-create-module.png[]
* With Java 9 support, a library or a container can now be added to the module path as opposed to the classpath:
image::images/java9-module-path.png[]
* Once an entry has been added to a project's module path, its contents and encapsulation properties can further be modified by double-clicking on the *Is modular* node (or using the *Edit* button while *Is modular* is selected):
** On the *Contents* tab individual modules inside a container like *JRE System Library* can be included or excluded by moving the module from left-to-right or vice versa. Modules shown in the lower right box are implicitly included, because they are required by one or more modules in the upper right box.
image::images/java9-module-container-contents.png[Configuring the Contents of a module container]
** On the *Details* tab the encapsulation of given modules can be further influenced. The following example shows how module `module.one` can be made to export one of its packages to the module of the current Java project:
image::images/java9-module-properties.png[]
** Toggling *Defines one or more modules* (see above screenshot) lets you specify whether a given regular (non-modular) jar file or project should be considered as an "automatic module". As a consequence of changes here, the entry will move to the Modulepath or Classpath accordingly.
* Java search now includes a new search scope - Module:
image::images/java9-module-search.png[]
* When a Java Runtime 9 is added to a project's build path, the launch configurations are created with "Dependencies" tab and not the old "Classpath" tab.
User can change the JRE of launch configuration and on the confirmation, the tab changes from "Classpath" to "Dependencies" or vice versa.
image::images/changing-tabs-launch-config.png[]
If Java project is modular and module is described in module_info.java, most of the dependencies will be defined in the Modular Entries.
image::images/modular-dependencies.png[]
If Java project is not modular, most of the dependencies will be defined in the Classpath Entries.
image::images/non-modular-dependencies.png[]
* A new QuickFix is offered on import statements to fix issues that are reported due to *missing module dependency*
This QuickFix is applicable if the project is a Java 9 project and has a `module-info.java`.
The QuickFix can be invoked from the editor:
image::images/java9-module-requires-on-import.png[]
Before the QuickFix is applied the module-info file looks as below
image::images/java9-before-adding-module-requires-on-import.png[]
After the QuickFix is invoked, ` module-info.java` will be updated to include `requires 'MODULE_NAME'`
image::images/java9-after-adding-module-requires-on-import.png[]
* A new QuickFix is available when you have an unresolved type in a Java file. If the unresolved type can be found in a Java 9 module, a QuickFix will be available to add an import type entry to your file reporting the error and add the required module dependency to `module-info.java` file.
This QuickFix is applicable if the project is a Java 9 project and has a `module-info.java` file.
The QuickFix can be invoked from the editor:
image::images/java9-module-requires-and-import-on-missing-type.png[]
Before the QuickFix is applied, the module-info file looks as below
image::images/java9-before-adding-module-requires-on-import.png[]
After the QuickFix is invoked, ` module-info.java` will be updated to include `requires 'MODULE_NAME'`
image::images/java9-after-adding-module-requires-on-import.png[]
After the QuickFix is applied, the required `import` statement is added to the file reporting error
image::images/java9-after-adding-import-module-requires-and-import-on-missing-type.png[]
* A new QuickFix is available when you have an unresolved type on `service provider` in a provides directive in module-info.java file. If the unresolved type can not be found in the current module, a QuickFix will be available to create a new class or an interface in the current module.
This QuickFix is applicable if the project is a Java 9 project and has a `module-info.java` file.
The QuickFix can be invoked from the editor:
image::images/java9-module-provides-create-class.png[]
image::images/java9-module-provides-create-interface.png[]
When the service is a class, the QuickFix is proposed for creating a class.
When the service is an interface or an annotation, two QuickFixes are proposed for creating a class or an interface.
Configure tags to include and exclude in JUnit launch configuration
You can provide tags to be included in or excluded from a test run in the *Configure Tags* dialog of JUnit launch configuration:
image::images/junit-tags.png[]
=== QuickFix to add `@NonNullByDefault` to packages
A new QuickFix is offered to fix issues that are reported when the *Missing '@NonNullByDefault' annotation on package* warning is enabled.
If the package already has a `package-info.java`, the QuickFix can be invoked from the editor:
image::images/add-nnbd-existing-packageinfo.png[]
Otherwise, the QuickFix must be invoked from the problems view, and will create a `package-info.java` with the required annotation:
image::images/add-nnbd-create-packageinfo.png[]
When invoked from the problems view, both variations of the QuickFix can fix the problem for multiple packages simultaneously.
=== Paste `module-info.java` code in Package Explorer
You can now paste a snippet of code representing module-info.java directly into a source folder to create a module-info.java file. For example, copy this code:
....
import java.sql.Driver;
module hello {
exports org.example;
requires java.sql;
provides Driver with org.example.DriverImpl;
}
....
Then select a source folder in a Java 9 project in the Package Explorer view and use *Ctrl+V (Edit > Paste)* to paste it. This automatically creates a module-info.java file in the source folder with the copied content.
=== Content assist for module declaration name
Content assist *(Ctrl+Space)* support is now available for module declaration name.
image::images/content-assist-module-declaration-name.png[]
=== Overriding modular build path dependencies for launching
Based on Java build path, a Java 9 module can have command line options. These options from build path can be overridden for launching programs in the module. *Override Dependencies* button has been added to *Dependencies* tab:
image::images/override-dependencies-button.png[Override Dependencies button]
Dialog can be used to override modular dependencies:
image::images/override-dependencies-dialog.png[Override Dependencies dialog]
=== Option for Regex in Module Declaration Search
This is an *experimental* support provided to allow the regular expression usage in search field while searching for module declaration. This can be considered as a wrapper of the link:#regex-module-declaration-search-api[API change]. To invoke the regular expression search from the search field under Java Search, start the expression with "/r " ie a slash '/', the letter 'r' and a blank ' ' (not tab) followed by a regex, an example of which is shown below:
image::images/mod.regex.trap.png[Trapdoor for regular expression module declaration search]
In the above example, all the characters trailing "/r " form a Java regular expression to denote a module name which starts with zero or more 'n's followed by the string ".ver" and followed again by zero or more number of arbitrary characters.
Another example would be to search for all modules that start with `java.x` followed by zero or more characters which is given by the regular expression `/r java\.x.*` - note the backslash for . to consider this as a "normal" character instead of the special regex]. Yet another example would be search for all module names that start with j followed by zero or more characters and ending with .xml which in regex language translates to `/r j.*\.xml` and here please note that the first '.' is the special regex character while the second '.' is escaped to denote that this is a normal character.
*Note:* You should use this only for *Declarations* search for modules as it is not implemented for module references. Selecting *All occurrences* in conjunction with regex will default to finding only the Declarations matching the regex ignoring the references.
=== `@NonNullByDefault` per module
If a module is annotated with `@NonNullByDefault`, the compiler will interpret this as the global default for all types in this module: `@org.eclipse.jdt.annotation.NonNullByDefault` +
`module my.nullsafe.mod { ...`
Note, however, that this requires an annotation type declared with target `ElementType.MODULE`. Since the annotation bundle `org.eclipse.jdt.annotation` is still compatible with Java 8, it cannot yet declare this target. In the interim, a preview version of this bundle with support for modules will be published by other means than the official SDK build.
=== Support for Regex Module Declaration Search
The existing method `SearchPattern#createPattern(String , int , int , int )` is enhanced for supporting regular expression search for module declarations. Please note that the flag `SearchPattern#R_REGEXP_MATCH` used for regular expression search is applicable exclusively for module declarations. No other flag (for eg.`SearchPattern#R_CASE_SENSITIVE`) should be used in disjunction with this match rule.
=== `@NonNullByDefault` improvements
When using annotation-based null analysis, there are now more ways to define which unannotated locations are implicitly assumed to be annotated as `@NonNull`:
* http://help.eclipse.org/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/annotation/NonNullByDefault.html[`@NonNullByDefault`] annotations based on enum http://help.eclipse.org/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/annotation/DefaultLocation.html[`DefaultLocation`] can be also used if the primary nullness annotations are declaration annotations (previously this was supported only for `TYPE_USE` annotations).
* Support for `@NonNullByDefault` annotations that are targeted at parameters has been implemented.
* Multiple different `@NonNullByDefault` annotations (especially with different default values) may be placed at the same target, in which case the sets of affected locations are merged.
* Annotations which use a meta annotation `@TypeQualifierDefault` instead of a `DefaultLocation`-based specification are now understood, too, e.g. https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/lang/NonNullApi.html[`@org.springframework.lang.NonNullApi`].
=== New `--release` on the Java compiler preference page
A new option `--release` is available on the Java compiler preference page.
This option will be enabled only if the JRE being used is a Java 9 or above.
Workspace Preference:
image::images/java9_release_option_workspace_preference_page.png[]
Project Preference:
image::images/java9_release_option_project_preference_page.png[]
In the past, it was possible to compile for an older version of the Java language.
However, the compiler always compiled against the platform APIs that is found in the project's build path.
*For Example:* If the JRE being used is java 1.8 and the compliance level is set to 1.7, the API's that are available are from the Java8 library, even if they were not part of Java 1.7.
The new `--release` compiler option now allows the user to configure compilation against a platform API version of user's choice.
*For Example:* Using `--release` option if the JRE being used is 9 and the compliance level is set to 1.7, the API's that are available will be from JRE 1.7 even if JRE 1.7 is not available in your workspace.
The `--release` option supports versions 1.6 and above. That is the `--release` option is enabled for JRE 9 and above, if the compliance is set to 1.6 or above
In the below picture, compliance is set to 1.5, therefore the `--release` option is disabled.
image::images/java9_release_option_disabled_project_preference_page.png[]
The `--release` option is enabled by default for all new projects created using JRE 9 or above.
Use `--release` option for Default Access rules and EE descriptor
Java 9 onwards, Access rules intrinsic to JRE will not be available by default. Users must use the `--release` option to configure compilation against the version of Java library of his or her preference.
From Java 10 and beyond, API tools Execution Environment Descriptions will not be provided to determine if references are present in execution environment or not. Users must use the `--release` option to configure compilation against platform API of his or her preference. If the user intends to enforce a particular version of Java for determining Java API references in a project, he or she can store this preference in the project settings.
=== QuickFix for `Non-existing or empty package` on ` exports directive`
A new QuickFix is available when you have a ` non-existing or an empty package` in an `exports directive` in module-info.java file.
This QuickFix is applicable if the project is a Java 9 project or above and has a `module-info.java` file.
The QuickFix can be invoked from the editor:
image::images/java9_quickfix_empty_nonexistant_package_on_exports_directive.png[]
A QuickFix is provided to create either a Class, or an Interface or an Annotation or an Enum in the given package.
If the package does not exist, a new package is created and the new element is created in the package.
=== QuickFix for `unresolved module` on module name in `requires directive`
A new QuickFix is offered on *requires* statements in the `module-info.java` file to fix issues that are reported due to unresolved module. The below QuickFix will be provided if the module related to the unresolved module error has its related classpath added to the class path and not to the module path.
This QuickFix is applicable if the project is a Java 9 project and has a `module-info.java` file
This QuickFix can be invoked from the editor.
image::images/java9-module-requires-move-from-classpath-to-modulepath-quickfix.png[]
Before the QuickFix is applied the classpath entries look as below:
image::images/java9-module-requires-move-from-classpath-to-modulepath-CPE-before-quickfix.png[]
After the QuickFix is applied the classpath entries look as below:
image::images/java9-module-requires-move-from-classpath-to-modulepath-CPE-after-quickfix.png[]
=== Creation of `module-info.java file` on creation of a New Java 9 Project
A new feature is offered on creation of a java project with compliance Java 9 or above for the creation of module-info.java file.
A new checkbox is added in page 2 of the project creation page, highlighted in RED in the Page 2 image below.
Page 1
image::images/create_Java_Project_1.png[]
Page 2
image::images/create_Java_Project_2.png[]
=== The new checkbox for the creation of `module-info.java` file is checked by default
If this checkbox is checked, upon project creation the below dialog will appear for creation of a new ` module-info.java ` file
image::images/create_module_info.png[]
Selecting `Don't Create` in the above dialog does not create the `module-info.java` file, but creates the project.
== Java(R) 10
http://docs.oracle.com/javase/10/[Javaâ„¢ 10] is here, and JDT supports it completely.
The Eclipse compiler for Java (ECJ) implements the new Java 10 https://docs.oracle.com/javase/10/language[language enhancement] which is the support for http://openjdk.java.net/jeps/286[*local variable type inference (JEP 286)*].
=== Addition of Java 10 JRE
A Java 10 JRE is recognized by Eclipse for launching. It can be added from the *Window > Preferences > Java > Installed JREs > Add...* page. It can be added from the *Package Explorer* as well using the project's context menu.
image::images/j10.png[]
An option to set compiler compliance to 10 on a Java project is provided.
image::images/j10.compliance.png[]
=== Support for `var` compilation
Compilation of `var` is supported as shown below:
image::images/var.compile.png[]
When the type of `var` cannot be inferred, it is flagged as a compiler error as expected. An example is shown below:
image::images/var.nocompile.png[]
=== Code Completion for `var`
Code completion is offered at places where `var` is allowed.
image::images/var.complete.png[]
Code completion of `var` is not offered at places where `var` is not allowed.
image::images/var.nocomplete.png[]
Hover over `var` shows the javadoc of the inferred type.
image::images/var.hover.png[]
=== Convert `var`
A QuickAssist to convert from `var` to the appropriate type is provided.
image::images/var.vartotype.png[]
A QuickAssist to convert from type to `var` is provided.
image::images/var.typetovar.png[]
=== QuickFix to change project compliance and JRE to 10
A QuickFix *Change project compliance and JRE to 10* is provided to quickly change the current project to be compatible with Java 10.
image::images/quickfix-change-compliance-10.png[]
== JUnit 5
=== Support for JUnit 5
http://junit.org/junit5/[JUnit 5] support is now available in Eclipse. Try it out with Eclipse Photon (4.8) M2 build or any of the available options from https://marketplace.eclipse.org/content/junit-5-support-oxygen[Eclipse Marketplace].
* Create a new JUnit Jupiter test via *New JUnit Test Case* wizard:
image::images/new-junit-jupiter-test.png[]
* Add JUnit 5 library to the build path:
** New JUnit Test Case wizard offers to add it while creating a new JUnit Jupiter test:
image::images/add-junit-5-lib.png[]
** QuickFix *(Ctrl+1)* proposal on `@Test`, `@TestFactory`, `@ParameterizedTest` and `@RepeatedTest` annotations:
image::images/add-junit-5-lib-quick-fix.png[]
** Add JUnit library in Java Build Path dialog:
image::images/add-junit-5-lib-java-build-path.png[]
* Create a JUnit Jupiter test method with the new *test_jupiter* template:
image::images/junit-jupiter-test-method-template.png[]
* Create a *`@TestFactory`* method with the new *test_factory* template:
image::images/junit-jupiter-test-factory-template.png[]
* JUnit Jupiter’s `Assertions`, `Assumptions`, `DynamicContainer` and `DynamicTest` classes are now added to *Eclipse Favorites* by default:
image::images/content-assist-favorites.png[]
This allows you to quickly import the static methods from these classes in your code via Content Assist *(Ctrl + Space)* and QuickFix *(Ctrl + 1)*.
* View all the failures from grouped assertions in the same *Result Comparison* dialog opened from JUnit view:
image::images/grouped-assertions-result-comparison.png[]
* View the number of disabled tests and tests with assumption failures on hover in JUnit view:
image::images/skipped-tests.png[]
* Use *Go to File* action or just double-click to navigate to the test from JUnit view even when the test is displayed with a custom name:
image::images/display-name.png[]
* (Re-)Run a single *`@Nested`* test class by using the *Run* action in JUnit view or Outline view. You can even right-click on a nested test class name in the editor and use the *Run As* action:
image::images/run-nested-class.png[]
* The *Test Method Selection* dialog in JUnit launch configuration now shows the method parameter types also:
image::images/test-method-selection-dialog.png[]
* Note: This functionality has been replaced with the new https://www.eclipse.org/eclipse/news/4.8/M3/#junit5-tags[Configure Tags] dialog in M3.
You can provide tags to be included in or excluded from a test run via *Program arguments* in the Arguments tab of JUnit launch configuration. The options are:
** --include-tag <String>
** --exclude-tag <String>
where <String> is a tag to be included in or excluded from the test run. These options can be repeated with newline separation:
image::images/junit-tags.png[]
*Note:*
* If you are using an Eclipse workspace where you were running your JUnit 5 tests via `@RunWith(JUnitPlatform.class)` in Eclipse without JUnit 5 support then you will have JUnit 4 as the test runner in their launch configurations. Before executing these tests in Eclipse with JUnit 5 support, you should either change their test runner to JUnit 5 or delete them so that new launch configurations are created with JUnit 5 test runner while running the tests:
image::images/test-runner-update.png[]
* We do not support running tests in a setup where an old Eclipse build (not having JUnit 5 support) is using a new Eclipse build (having JUnit 5 support) as target. Also, developers who have the JDT JUnit runtime bundles `(org.eclipse.jdt.junit.runtime, org.eclipse.jdt.junit4.runtime)` checked out and pull the latest changes will run into the above issue. You are expected to use a new Eclipse build for the development.
=== `TestReporter` entries displayed in Console view
In JUnit Jupiter, a method parameter of type `TestReporter` can be used to publish additional data about the current test run which can be viewed in the *Console view*:
image::images/junit5-test-reporter.png[]
image::images/junit5-test-reporter-console-view.png[]
== Debugging
=== Advanced source lookup implementation
More precise "advanced" source lookup implementation, particularly useful when debugging applications that load classes dynamically at runtime. Advanced source lookup affects debug launches only and can be enabled or disabled with *Java > Debug > Enable advanced source lookup* preference option:
image::images/advanced-source-lookup.png[]
=== Debugger listens to thread name changes
Debug view now automatically updates thread names if they are changed in the debugged JVM. This shows live information for worker instances, as described above.
Technically speaking, Java debugger automatically adds a new (user invisible) breakpoint in the JVM and notifies clients (like Debug view) on a breakpoint hit. If this behavior is undesired for some reason, product owners can disable it via product customization.
The property value is: `org.eclipse.jdt.debug.ui/org.eclipse.jdt.debug.ui.javaDebug.ListenOnThreadNameChanges=false`
=== Value displayed for method exit and exception breakpoints
When a *method exit breakpoint* is hit, the value being returned is now shown in the variables view.
image::images/returningvalue.png[]
Similar, when an *exception breakpoint* is hit, the exception being thrown is shown.
image::images/throwingexception.png[]
=== Display view now named Debug Shell
The Display view has been renamed to *Debug Shell* to better match the features and purpose of this feature. A line of Java comment have also been added to the view on fresh open to encourage trying it further.
image::images/debugShell.png[Debug Shell]
=== Launch configuration prototypes for Java Launch Configurations
A Java Launch Configuration can now be based on a prototype.
image::images/prototype-java-launch-configuration.png[Prototype Java Launch Configuration]
A prototype seeds attributes in its associated Java Launch Configurations with the settings specified in the Prototype tab.
image::images/prototype-tab-java-launch-configuration-1.png[Prototype Tab Java Launch Configuration 1]
Once a Java Launch Configuration has been created, you can override any initial settings from the prototype. You can also reset the settings of a Java Launch Configuration with the ones from its prototype. A Java Launch Configuration maintains a link to its prototype, but is a complete stand-alone launch configuration than can be launched, exported, shared, etc.
image::images/prototype-tab-java-launch-configuration-2.png[Prototype Tab Java Launch Configuration 2]
== Other
=== Improved Java syntax coloring in the dark theme
To improve readability in the dark theme, bold style usage has been reduced and some colors that were too close to each other have been altered.
image::images/java-syntax-dark.png[]
=== Escape non-ASCII characters when pasting into a string literal
The *Java > Editor > Typing > Escape text when pasting into a string literal* preference option now has a suboption *Use Unicode escape syntax for non-ASCII characters*:
image::images/escape-non-ascii-settings.png[]
When enabled, characters outside the visible ASCII range will be replaced by unicode escape sequences when pasted into a string:
image::images/escape-non-ascii-example.png[]
=== Navigate to 'switch' statement
You can now *Ctrl+click* or use *Open Declaration (F3)* on `case` or `default` keywords to quickly navigate to the beginning of the `switch` statement.
image::images/navigate-to-switch.png[]
=== New formatter profile page
The formatter profile preference page *(Java > Code Style > Formatter > Edit...)* has a new look which makes it much easier to set preferences for formatting Java code. Instead of multiple tabs, all preferences are presented in an expandable tree.
image::images/formatter-profile-overview.png[]
You can use *filtering* to display only settings with names matching a specific phrase. Filtering by values is also possible (prefix a value filter with a tilde).
image::images/formatter-profile-filtering.png[Example filtering by word 'lambda']
Most sections have a *"Modify all"* button in their header that lets you set all their preferences to the same value with one click.
image::images/formatter-profile-modify-all.png[]
Some preferences have more convenient controls. For example, number values can be easily modified with arrow buttons. Wrap policy settings are controlled by simple toolbars so that you can see and compare multiple policies at once.
image::images/formatter-profile-wrap-settings.png[]
In the preview panel you can now use your own code to immediately see how it will be affected by the modified settings. You can also see the raw form of standard preview samples and make temporary modifications to them.
image::images/formatter-profile-preview.png[New buttons: 'View/edit raw code' and 'Custom preview contents']
=== Test sources
In the *Java Build Path* project settings, there is now an attribute *Contains test sources* to configure that a source folder contains test sources (Note: test sources must have their own output folder). Similar, for projects and libraries there is an attribute *Visible only for test sources*. This setting also exists for classpath containers, and if it is set to *Yes* for one of these, this value will be used for all contained libraries and projects.
image::images/1-sourcefolder-settings-521330.png[]
Test source folders and dependencies are shown with a darker icon in the build path settings, the package explorer and other locations. This can be disabled in *Preferences > Java > Appearance*:
image::images/1a-modified-test-icon-preferences-530179.png[]
Referenced projects can contain test sources and have test dependencies themselves. Usually, when test sources are compiled, the test code in projects on the build path will be visible. As this is not always desirable, it can be changed by setting the new build path attribute *Without test code*, that is available for projects, to *Yes*.
image::images/2-without-test-code-526858.png[]
Build path entries configured like this have a decoration `[without test code]` after the project name, which can be disabled in *Preferences > General > Appearance > Label Decorations*:
image::images/2a-without-test-code-decorator-530179.png[]
For each project, compilation is now done in two phases: First all main sources (which cannot see any test-code on the build-path) and then all test sources.
image::images/3-visibilities-224708.png[]
As a consequence, if the project is a modular Java 9 project, test dependencies like JUnit can not be referenced in the `module-info.java`, as they will not be visible while compiling it. The solution used to handle this is the same, that Maven uses: When test dependencies are put on the classpath, the module being compiled will automatically be configured to read the unnamed module during the compilation of the test sources, so the test dependencies will be visible.
Of course, code completion will not suggest test code in main sources:
image::images/4a-completion-in-main-521331.png[]
image::images/4b-completion-in-test-521331.png[]
There are now two dynamic Java working sets *Java Main Sources* and *Java Test Sources* containing the source folders grouped according to value of the *Contains test sources* attribute. This can for example be used to remove warnings in test sources from the problems view:
image::images/5a-problems-view-521336.png[]
To achieve this, create a new filter that shows warnings for the *Java Main Sources* working set and select it with the *All Errors on Workspace* filter:
image::images/5b-problems-view-filters-521336.png[]
There are also dedicated filters to quickly remove hits in main code or test code from Java search results:
image::images/6-filter-search-result-521332.png[]
Similar, there is a filter to remove test code from *Call hierarchies*:
image::images/7-filter-call-hierarchy-521335.png[]
Another filter to remove test code exists for *Quick type hierarchies*:
image::images/8-filter-quick-type-hierarchy-521333.png[]
Test source folders will be preselected in the *New JUnit Test Case*-Wizard
image::images/9-new-junit-332602.png[]
In Run and Debug configurations, the *Classpath* tab (or *Dependencies* tab when launching with Java 9) contains a new option *Exclude Test Code*, that is automatically preselected when launching a Java Application from a source folder that is not marked to contain test sources:
image::images/10-launching-529321.png[]
When launching with Java 9 and this option is not selected, command line options will automatically be added so modules that have a non-empty classpath read the unnamed module. These command line options are part of what can be overridden using the new link:#override-dependencies[Override Dependencies] button.
=== Test sources
There is now support for running Java annotation processors on link:../M5/index.html#jdt-test-sources[test sources]. The output folder for files generated for these can be configured in the project properties in *Java Compiler > Annotation Processing* as *Generated test source directory*
image::images/testsources-apt-531072.png[]
=== Generate dialogs use verbs instead of OK
The "Generate..." dialogs of the Java tools have been adapted to use verbs instead of OK.
=== Sort library entries alphabetically in Package Explorer
The content of libraries are displayed in the order of the classpath. This makes it difficult to find specific libraries by their name, especially when projects have many dependencies. The *library entries can now be sorted alphabetically* when setting the preference "Sort library entries alphabetically in Package Explorer" on the *Java > Appearance* preference page:
image::images/jdt_sort_library_pref.png[]
=== Formatter: align Javadoc tags in columns
The formatter can now *align names and/or descriptions* in Javadoc tags in new ways. The formatter profile editor is available for selection, under *Comments > Javadoc*.
image::images/formatter-javadoc-prefs.png[]
For example, the *Align descriptions, grouped by type* setting is now used in the built-in Eclipse profile.
image::images/formatter-javadoc-preview.png[]
The setting previously known as *Indent Javadoc tags* is now called *Align descriptions to tag width*. The two settings related to *@param tags* also had their labels changed to better describe what they do.
=== New Cleanup Action "Remove redundant modifiers"
The new cleanup action "Remove redundant modifiers" removes unnecessary modifiers on types, methods and fields. The following modifiers are removed:
* Interface field declarations: `public`, `static`, `final`
* Interface method declarations: `public`, `abstract`
* Nested interfaces: `static`
* Method declarations in final classes: `final`
The cleanup action can be configured as save action on the _Unnecessary Code_ page.
image::images/jdt_remove_redundant_modifiers.png[]
=== Improved coloring of inherited members in the Quick Outline in the dark theme
The Eclipse default dark theme now includes styling of inherited members in JDT's *Quick Outline*. This improves readability in the dark theme a lot. The color can be configured via the "Java > Inherited Members" color definition on the *Colors and Fonts* preference page.
Before:
image::images/inherited_before.png[before]
After:
image::images/inherited_after.png[after]
=== Java code formatter preferences now styled for the dark theme
The formatter preferences tree styling has been fixed to work properly in the dark theme.