JDK9Support

(Difference between revisions)
(What DOES NOT work)
 
(13 intermediate revisions not shown)
Line 1: Line 1:
-
<h1>JDK9 EA Support</H1>
+
NetBeans has been donated by Oracle to Apache, where it continues to be actively developed. Go to [https://netbeans.apache.org netbeans.apache.org] for the latest details, go to [https://netbeans.apache.org/download/nb90/ https://netbeans.apache.org/download/nb90] in particular.
-
'''NOTE''' - JDK 8 or JDK 9 EA '''build 147''' is required for NetBeans development builds. More on this below in 
+
 
-
[[#not_working|What does not Work chapter]].
+
<!--
 +
 
 +
<h1>Oracle NetBeans</h1>
 +
 
 +
<h3>JDK9 EA Support</h3>
 +
'''NOTE''' Always use latest JDK9 EA build when working with NetBeans Daily development builds. Refer to [[#not_working|What does not Work chapter]] for latest updates on compatibility issues.
NetBeans IDE [http://bits.netbeans.org/download/trunk/nightly/latest/ Daily Development builds] contains also early (under development) support for [https://jdk9.java.net/download/ JDK 9 EA development builds] namely the new modular system for Java. (Download http://bits.netbeans.org/download/trunk/nightly/latest/)
NetBeans IDE [http://bits.netbeans.org/download/trunk/nightly/latest/ Daily Development builds] contains also early (under development) support for [https://jdk9.java.net/download/ JDK 9 EA development builds] namely the new modular system for Java. (Download http://bits.netbeans.org/download/trunk/nightly/latest/)
Line 27: Line 32:
NetBeans JDK 9 builds support:  
NetBeans JDK 9 builds support:  
* NB Java SE project support one JDK9/Jigsaw module - Single module project.  
* NB Java SE project support one JDK9/Jigsaw module - Single module project.  
 +
* Java SE Multi module project - Ant based project containing several modules and compiling them at once.
* Maven projects  
* Maven projects  
* module-info.java support: editing works and using its statement to set module boundaries for projects
* module-info.java support: editing works and using its statement to set module boundaries for projects
Line 38: Line 44:
<span id="not_working"></span>
<span id="not_working"></span>
==What DOES NOT work==
==What DOES NOT work==
-
===JDK 9 EA build 148 and later===
+
===Strong Encapsulation===
-
JDK 9 EA changes in recent build 148 will require significant changes in NB daily builds. NB will '''not RUN''' on top of JDK9 EA build 148 and later. JDK 9 EA b 148 and later '''CANNOT''' be used as Java Platform for IDE Java SE 9 projects. JDK9 EA build 148 introduced big changes as described in [http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-November/005276.html Refresh of module system coming to jdk9/dev soon]. The fixes of this will take a time. NetBeans 9 will not work with several following JDK9 EA builds.
+
When running NetBeans IDE daily Dev build on top of JDK9 EA build 150 or newer you might experience issues when some APIs are not accessible, this is due to [http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-November/005276.html strong encapsulation of APIs in non exported packages invoked through setAccessible()] - this no longer works in b150 and newer. Similar exception will be printed to terminal or log file:
-
+
<pre>
-
Also due to JDK bug  [https://bugs.openjdk.java.net/browse/JDK-8169435 JDK-8169435] NetBeans IDE failed to start on top of b143-b146. It is fixed since b147.  
+
java.lang.reflect.InaccessibleObjectException: Unable to make field transient some_package.some_class.some_field accessible: module java.xyz does not "opens abc.xyz" to unnamed module @2a5ca609
-
'''If you want to run NB development build on top of JDK 9 EA then stay with b147'''. The same for using JDK9 EA as IDE project Java Platform. IDE continues to run and work with JDK8.
+
at ....
-
===Other features===
+
</pre>
-
* Multiple JDK9 modules in one NB project
+
Particular class/field/module might vary. NetBeans IDE JavaSE and JS distributions were fixed since daily build 201701130001 (Jan 13th) and now opens several packages for reflection. It might happen than when running daily dev build on top of JDK9 EA with additional modules/clusters installed then setAccessible to some other field might be used. It might be also invoked from bundled 3rd party library we even cannot fix. In such a case add a statement like this, e.g. '''-J--add-opens java.base/java.util=ALL-UNNAMED''' (provide your module and package) to netbeans.conf '''netbeans_default_options=''' and run IDE again. For modules in standard netbeans distros (Java EE,...) report the bug to NB Bugzilla using JDK_9 keyword. We will fix that in netbeans.conf in upcoming daily build.
 +
 
== How to start ==
== How to start ==
Line 87: Line 94:
[[image: JunitTestsInModule.png]]
[[image: JunitTestsInModule.png]]
-
The structure is very similar to non-modular Java development. Simply add JUnit tests into Test Packages or leverage existing JUnit tests in a project. Then run the tests using ''project'' context menu '''Test  Alt+F6'' or ''Test File'' (Ctrl+F6) for single Java file.
+
The structure is very similar to non-modular Java development. Simply add JUnit tests into Test Packages or leverage existing JUnit tests in a project. Junit jar file needs to be added to Test Libraries. Then run the tests using ''project'' context menu '''Test  Alt+F6'' or ''Test File'' (Ctrl+F6) for single Java file.
==== JUnit tests in own module ====
==== JUnit tests in own module ====
Line 113: Line 120:
[[image:add_dependency_2_nodule_info.png]]
[[image:add_dependency_2_nodule_info.png]]
-
NetBeans Maven support is under development to provide other productivity features for Maven projects.
+
==== Unit testing ====
 +
Unit testing is possible as of Apache Maven Compiler Pluging v 3.6.1
-
==== maven-surefire-plugin ====
+
=== What does not work  ===
-
* Unit tests are not working, waiting for Maven Surefire plugin to support JDK9.
+
NetBeans Maven support is under development to provide other productivity features for Maven projects.
-
* has  to support modulepath
+
==== maven-javadoc-plugin ====
==== maven-javadoc-plugin ====
Line 145: Line 152:
====Changing NetBeans JDK runtime platform====
====Changing NetBeans JDK runtime platform====
How to change a JDK NetBeans uses for runtime is specified [[FaqJdkHome]] or in [[FaqNetbeansConf]].
How to change a JDK NetBeans uses for runtime is specified [[FaqJdkHome]] or in [[FaqNetbeansConf]].
 +
 +
-->

Current revision as of 08:28, 21 July 2018

NetBeans has been donated by Oracle to Apache, where it continues to be actively developed. Go to netbeans.apache.org for the latest details, go to https://netbeans.apache.org/download/nb90 in particular.


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