Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Java9/Examples"

m
m
Line 62: Line 62:
 
| Two compiler errors " Cycle exists in module dependencies, Module second requires itself via first"
 
| Two compiler errors " Cycle exists in module dependencies, Module second requires itself via first"
 
|-
 
|-
! scope="row" | Implementation TypeRef Completion
+
! colspan="3" | Code Select, Hover, Navigate &  Search in module-info.java file
| after provides Typename with press completion key  || Type completion shown and these typereferences are implmentations of the type given before with.|-
+
! colspan="3" | Search in module-info.java file
+
 
|-
 
|-
! scope="row" | Keyword Completion
+
! scope="row" | Module Select & Hover
| In a module-info.java file, after module module_name {, press completion key (for eg, ctrl+space in windows)  || keywords exports, opens, requires, provides and uses shown
+
| In the module-info.java file of the first project, select second in the requires second; statement
 +
| Hover appears
 +
|-
 +
! scope="row" | Module Select, Hover & Navigate
 +
| In the above scenario, after hover appears, click on the navigate
 +
| module-info.java file of second opened
 +
|-
 +
! scope="row" | Module Select,  & Search
 +
| In the module-info.java file of the second project, select second in the module second; statement and search for references
 +
| In the search view, the reference of second in first -> module-info.java is shown.
 
|-
 
|-
 
! scope="row" | Keyword Completion - 2  
 
! scope="row" | Keyword Completion - 2  

Revision as of 02:12, 28 June 2017

This is an informal page listing out examples of features that are implemented for Java 9. You are welcome to try out these examples. If bugs are found please check [here] for duplicates first and if not found, please file a bug.


List of Java 9 Features>
Sub Feature Feature Title / Try It Out Steps Expected Result
Java 9 JRE Support
Add Java 9 Use Eclipse Preferences -> Java -> Installed JREs -> Add Java 9 JRE recognized as a valid JRE
Project JRE In Package Explorer Use Project Context Menu and add Java 9 JRE JRE specific (eg Object) gets resolved in the project.
Package Explorer Go to Package Explorer and expand the Java 9 JRE Modules (eg java.base etc) are listed in the package explorer view
Module Creation
Manual Context Menu of src -> New -> File - give the module-info.java as name no compiler errors
Automatic Context Menu of Project -> Cofigure -> Create module-info. A default module-info.java with all packages exported should be created
Completion in module-info.java file
Keyword Completion In a module-info.java file, after module module_name {, press completion key (for eg, ctrl+space in windows) keywords exports, opens, requires, provides and uses shown
Keyword Completion - 2 after exports packagename, or opens packagename press completion key keyword to is shown as an option
Package Completion after exports, opens, provides or uses, press completion key package completion shown.
Type Reference Completion after exports, opens, provides or uses, or optionally after a dot after a package, ie exports packagename. press completion key Type completion shown.
Implementation TypeRef Completion after provides Typename with press completion key Type completion shown and these typereferences are implmentations of the type given before with.
Module Dependency - Compilation / Error Reporting
Unspecified Dependency create projects "first" and "second" and create module-info.java files in each of giving the module names "first" and "second" respectively. In the first module add statement requires second; Compiler gives error "second cannot be resolved to a module"
Define Dependency In the above scenario, add Project second as a dependent project for project first Compiler error goes away
Duplicate Dependency Continuing from the above scenario, add a duplicate requires second; statement in the module-info.java file of the first Compiler gives error "Duplicate requires entry: second"
Circular Dependency add a circular dependency ie add second project dependent on first and then add requires first; statement in the module-info.java file of the second Two compiler errors " Cycle exists in module dependencies, Module second requires itself via first"
Code Select, Hover, Navigate & Search in module-info.java file
Module Select & Hover In the module-info.java file of the first project, select second in the requires second; statement Hover appears
Module Select, Hover & Navigate In the above scenario, after hover appears, click on the navigate module-info.java file of second opened
Module Select, & Search In the module-info.java file of the second project, select second in the module second; statement and search for references In the search view, the reference of second in first -> module-info.java is shown.
Keyword Completion - 2 after exports packagename, or opens packagename press completion key keyword to is shown as an option
Package Completion after exports, opens, provides or uses, press completion key package completion shown.
Type Reference Completion after exports, opens, provides or uses, or optionally after a dot after a package, ie exports packagename. press completion key Type completion shown.
Implementation TypeRef Completion after provides Typename with press completion key Type completion shown and these typereferences are implmentations of the type given before with.

Back to the top