NewAndNoteworthyNB9

Revision as of 15:50, 16 May 2017 by Jpirek (Talk | contribs)

NetBeans 9 runtime platforms are only JDK8 and JDK9. Until JDK9 is GA it is recommended to run NB9 on top of JDK8 which is more stable. JDK9 can be used as Projects Java Platform even NetBeans itself is running on top of JDK8.

Contents

Java Platform Module System Support

Java Application project extensions

NetBeans 9 supports JPMS (Jigsaw) to full extent. Modulepath was added as a crucial paradigm to NetBeans in addition to Classpath.

Standard NetBeans Java SE Project (Ant) can be a single JDK9 module simply by adding module-info.java into default package.

File:Add_module-info.png

module-info.java supports code completion,...

File:Module_info_CC.png

Full Edit - Compile - Debug and Profile cycle is supported. Java SE projects with JDK9 module can define dependencies on themselves using Project Libraries customizer dialog and by defining appropriate exports and requires in their module-info.java files.

File:ProjectDependencies.png

This picture shows dependency of 1 project on 2 other projects. The mix of projects with module-info.java or without it is allowed. Modulepath and Classpath are supported.

File:ModuleDependenciesGraph.png

It is possible to show module dependencies graph for each module-info.java.

Java SE Project allows to develop and store JUnit tests:

  1. inside same module. In this case no changes to develop and execute tests are needed in main module-info.java
  2. in its own JUnit JDK9 module (own module-info.java). In this case main module-info.java exports the tested packages and tests module-info. java requires application module and JUnit...

The picture below shows the structure of JavaSE projects with JUnit tests in same module and with own module:

File:JavaSEProjects.png

Java Modular Application Project type

New project called Java Modular project was added. This allows to develop several JDK9 modules in one NetBeans project (Ant based). Advantage of this project over several Java SE project each containing 1 module is that dependencies are simply managed by declaring appropriate exports and requires in module-info.java files and all modules in the project are being compiled at once.

File:NewMultiModule.png

Following picture depicts how Java Modular Project can look like.

File:MultimoduleStructure.png

Other Java 9 features

Every JavaSE (with module-info.java) or Java Modular App project can be packaged into JLink image allowing seamless distribution of app and required modules. File:JLinkDistro.png

HTML5 tags are supported in NetBeans editor and HTML5 JavaDoc can be generated using projects Properties | Documenting customizer.

Maven projects and JDK 9 modules

JavaShell

Java Shell is a tool in JDK9 defined in JEP 222 to introduce REPL (read-eval-print-loop) capabilities to Java. NetBeans provides integrated console-like UI for the Java Shell, leveraing NetBeans editor capabilites. NetBeans can support the tool with the user project configuration, so the Java Shell is set up to work with project classes and libraries. File:jshell-completion.png


NetBeans IDE greatly extends capabilities of the commandline tool. NetBeans can execute the shell as an agent, similar to debugging agent, on the debugged or run application - currently only J2SE applications are supported, both Ant and Maven-based. File:jshell-project.png

The developer can use Java Shell as an agent within the running process (even without a debugger), to inspect internal state, alter it and trigger events. File:Jshell-run

Snippets written in JShell can be redefined and tested, even against a running code. When prototype is ready, it can be saved to a regular java source file and integrated with the project. File:jshell-prototype1.png File:jshell-prototype-saved.png

PHP

All the PHP support for NetBeans 9 was contributed by our NetBeans user Junichi Yamamoto.

PHP 7.1 Support

  • Class constant visibility

File:Nb90_php_editor_class_constant_visibility_01.png

File:Nb90_php_editor_class_constant_visibility_02.png

  • Multi catch exception handling

File:Nb90_php_editor_multi_catch_exception_handling.png

  • Nullable types

File:Nb90_php_editor_nullable_types.png

  • Support for keys in list()

File:Nb90_php_editor_support_for_key_in_list.png

  • Coloring for new keywords(void, iterable)

File:Nb90_php_editor_coloring_for_new_keywords.png

  • PHP version in Project Properties dialog

File:Nb90_php_editor_php_version_in_project_properties_dialog.png

PHP 7.0 Support

  • Context sensitive lexer

File:Nb90_php_editor_context_sensitive_lexer.png

Editor

  • Hint for void return types

File:Nb90_php_editor_hint_for_void_return_types.png

  • Hint for incorrect non-abstract methods

File:Nb90_php_editor_hint_for_incorrect_non_abstract_methods.png

  • Suggestion for the strict types declaration. It is suggested when the caret is on the line which contains "<?php" and the file doesn't have the declaration.

File:Nb90_php_editor_suggestion_for_the_strict_types_declaration.png

  • Lowercase code completion for TRUE, FALSE, and NULL constants. Enabled by default.

File:Nb90_php_editor_lowercase_code_completion_01.png

File:Nb90_php_editor_lowercase_code_completion_02.png

  • Code folding for arrays

File:Nb90_php_editor_folding_arrays.png

File:Nb90_php_editor_folding_arrays.gif

Twig

  • Autocompletion for delimiters, brackets, and quotes

File:Nb90_php_twig_autocomplete.png

File:Nb90_php_twig_autocomplete.gif

test

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo