JDK9Support

(Difference between revisions)
Line 1: Line 1:
-
<H1>About the NetBeans IDE JDK9 Support in Development Build</H1>
+
<h1>JDK9 EA Support</H1>
-
NetBeans development builds (master) contains support for JDK9 EA builds https://jdk9.java.net/. Using NetBeans daily development build it is possible to set JDK9 EA buils as NetBeans IDE Java Platform.
+
NetBeans IDE previews an early experimental support for [https://jdk9.java.net/download/ JDK 9 EA development builds] including project Jigsaw - modular system for Java.
 +
NetBeans team provides this as a preview of development work done in NetBeans IDE with a goal to have a good, usable support of JDK9 with modules (Jigsaw project) at a time of release of JDK9. Features are not complete and WILL break in the future. JDK9 and Jigsaw project are also moving targets which did not reach Feature complete yet.
 +
 +
The work started for Java SE support and projects (NB Ant project) other areas like Java EE or Maven are not being worked on for JDK9 EA at this time. Later when Java SE support will be in desired state NetBeans developers of all other modules should start to use this for their work on making other NB modules to support JDK 9 EA and module system.
-
'''Note.''' NetBeans IDE itself does not run on JDK 9 builds yet. The focus of NetBeans development builds is to let you use JDK 9 in your own applications, not to run NetBeans IDE itself on top of JDK9, at this stage of NetBeans and JDK9 development.
+
Sources and builds are available on '''AS IS''' basis without any warranty. [https://netbeans.org/bugzilla/enter_bug.cgi Bugs could be filled] for JDK 9 EA support into bugzilla with Keyword '''JDK_9'''.  
 +
 
 +
Features and UI is still being designed and will change. Don't use these builds for real work! A lot of exceptions ...
 +
 
 +
NetBeans Jigsaw prototyping goes on in '''jet-main''' repository on a branch '''jdk9'''. Daily builds are available at http://deadlock.netbeans.org/job/NB-for-JDK9_jigsaw/ with JavaSE build available for download from http://deadlock.netbeans.org/job/NB-for-JDK9_jigsaw/ws/dist/zip/
==Getting Started==
==Getting Started==
-
# The NetBeans Dev daily build runs on top of Java SE 8, you can download the latest update of [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 8 here]. JDK 7 and older is not supported by NetBeans after NetBeans 8.1 release.
+
# The NetBeans JDK 9 build runs on top of Java SE 8, you can download the latest update of [http://www.oracle.com/technetwork/java/javase/downloads/index.html Java SE 8 here]. JDK 7 and older is not supported by NetBeans after NetBeans 8.1 release.
-
# Download the latest JDK 9 Early access build from [https://jdk9.java.net/ JDK 9 project snapshots] page.  
+
# Download the latest JDK 9 Early Access from https://jdk9.java.net/download/ page.  
-
# [http://bits.netbeans.org/download/trunk/nightly/latest/ Download the NetBeans Dev daily build here].  
+
# Download NB JDK 9 dev build from http://bits.netbeans.org/download/ or from http://deadlock.netbeans.org/job/NB-for-JDK9_jigsaw/ws/dist/zip/ or build it from sources.
-
# Register the latest JDK 9 Early access build as a ''Java Platform'' in NetBeans JDK9 build by means of ''Tools | Java Platforms | Add Platform''.
+
# Register the latest JDK 9 EA build as a ''Java Platform'' in NetBeans JDK9 build by means of ''Tools | Java Platforms | Add Platform''.  
-
# Once the above is done, the JDK 9 Early access build can be selected in the NetBeans ''Project Properties dialog > Libraries | Java Platform''.
+
==What works==
==What works==
-
NetBeans Dev daily build supports:  
+
NetBeans JDK 9 builds supports:  
-
* Java SE projects
+
* NB Java SE project support one JDK9/Jigsaw module - Single module project.
-
* JavaFX projects
+
* module-info.java support: editing works and using its statement to set module boundaries for projects
-
* NetBeans Ant project
+
* All Editing features work according to what is declared in module-info.java
-
* Maven projects
+
* Using other NB Java SE Single module projects as libraries (project dependency) is possible
-
* Debugging
+
* Compilation works
-
* Profiling of JDK9 VM from NetBeans JDK9 build
+
* Run & Debug projects work  
-
* All Editing features work
+
* All other features unrelated to Java language like SCM should work.
-
* All other features unrelated to Java language like SCM work.
+
 
 +
==What DOES NOT work==
 +
At this moment (Feb 23rd, 2016) all features not listed above don't work. Namely:
 +
* Unit tests support is not yet implemented.
 +
* Maven projects don't work
 +
 
 +
== How to start ==
 +
Add JDK9 EA as a Java Platform
-
Register JDK9 as a NetBeans Java Platform. You will see something like this:
+
[[image: Jigsaw_J_Platform.png]]
-
[[image:Jdk-9-register-1.png‎]]
+
After adding JDK 9 EA as Java Platform to NetBeans create Jave SE project using New Project wizard. Then add module-info.java. It is available under New File templates in category Java.
-
Once you have registered JDK9, you're able to specify that a project should use it:
+
[[image: Jigsaw_New_m-i.j.png]]
 +
 +
java.base module is by default added to any Jigsaw app. You can now edit module-info.java with requires,...
-
[[image:Jdk-9-build-switch.png‎]]
+
[[image: Jigsaw_m-i.j.png]]
-
Working with Java sources in a project targeting JDK9 is seamless, all features work, e.g., code completion:
+
Project can have also dependency on another JDK 9 EA modular (module-info.java) NB project. Use Project Properties | Libraries customizer to add JDK 9 EA project under Modules tab using Add Project... button.  
-
[[image:Jdk-9-build-cc.png]]
+
[[image: Jigsaw_Libs.png]]  
-
===Javac used===
 
-
The NetBeans Dev daily build uses JDK 9 Javac internally. In current builds of javac, there are no limitations except it '''compiles only java sources with -source option 1.6 and higher'''. Source level 1.5 and older is not supported by JDK9 javac.
 
-
Turn OFF '''Compile on Save''' in Project properties dialog ''Build | Compiling'' in a case javac from JDK 9 Java Platform needs to be used for '''Build''' or '''Clean & Build''' actions. This is useful in case your project uses Java Platform built from latest JDK9 sources with features not available in NB internal Javac.
+
== Other Features ==
 +
===Module Dependency Graph===
 +
The '''Graph''' View of the module-info.java file provides module dependency graph.
 +
[[image: ModuleGraph.png]]
-
==Bug reporting==
+
==Running NetBeans on JDK9 EA as run time Java platform==
-
The NetBeans JDK9 support is in early stage of development and JDK9 itself has not reached its feature complete status. Therefore, it is possible that you will encounter instabilities, while some features might not work when JDK9 is used as a Java Platform for your projects. Please provide us feedback on the build, either by using [https://netbeans.org/bugzilla/enter_bug.cgi Bugzilla reports] use '''JDK_9''' keyword to mark bugs found when using JDK9 build, or by sending an e-mail to us at the nbusers@netbeans.org mailing list -- please put '''[JDK9]''' in the subject of your email.
+
It is possible to try this NetBeans build run on JDK9 EA build. Use it with care as following command line switches might not be complete. Command lines for running NetBeans JDK 9 branch build on top of JDK9
-
==FAQ==
+
====Linux====
-
# Q: Is Jigsaw https://jdk9.java.net/jigsaw/ build supported?
+
<pre> $ bin/netbeans --jdkhome ~/jigsaw_b96 -J-XaddExports:java.desktop/sun.awt=ALL-UNNAMED,java.base/jdk.internal.jrtfs=ALL-UNNAMED,\
-
## A: See [[JigsawSupport | JDK9 Jigsaw Support]]
+
java.desktop/java.awt.peer=ALL-UNNAMED,java.desktop/com.sun.beans.editors=ALL-UNNAMED,java.desktop/sun.awt.im=ALL-UNNAMED,\
-
# Q: Is Java Shell http://openjdk.java.net/jeps/222 supported
+
java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED,java.management/sun.management=ALL-UNNAMED
-
## A: Not at the moment
+
</pre>
-
# Q: Are Variable Handles http://openjdk.java.net/jeps/193 supported
+
====Mac OSX====
-
## A: Not yet.
+
<pre> $ bin/netbeans --jdkhome ~/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home -J-XaddExports:java.desktop/com.apple.eawt=ALL-UNNAMED,\
 +
java.desktop/sun.awt=ALL-UNNAMED,java.base/jdk.internal.jrtfs=ALL-UNNAMED,java.desktop/apple.laf=ALL-UNNAMED,java.desktop/java.awt.peer=ALL-UNNAMED,\
 +
java.desktop/com.sun.beans.editors=ALL-UNNAMED,java.desktop/sun.awt.im=ALL-UNNAMED,java.management/sun.management=ALL-UNNAMED
 +
</pre>
 +
====Windows====
 +
<pre> > bin\netbeans.exe --jdkhome C:\jigsaw -J-Djdk.launcher.addexports=java.desktop/sun.awt=ALL-UNNAMED,java.base/jdk.internal.jrtfs=ALL-UNNAMED,
 +
java.desktop/java.awt.peer=ALL-UNNAMED,java.desktop/com.sun.beans.editors=ALL-UNNAMED,java.desktop/sun.awt.im=ALL-UNNAMED,
 +
java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED,java.management/sun.management=ALL-UNNAMED
 +
</pre>

Revision as of 14:24, 29 March 2016

Contents

JDK9 EA Support

NetBeans IDE previews an early experimental support for JDK 9 EA development builds including project Jigsaw - modular system for Java. NetBeans team provides this as a preview of development work done in NetBeans IDE with a goal to have a good, usable support of JDK9 with modules (Jigsaw project) at a time of release of JDK9. Features are not complete and WILL break in the future. JDK9 and Jigsaw project are also moving targets which did not reach Feature complete yet.

The work started for Java SE support and projects (NB Ant project) other areas like Java EE or Maven are not being worked on for JDK9 EA at this time. Later when Java SE support will be in desired state NetBeans developers of all other modules should start to use this for their work on making other NB modules to support JDK 9 EA and module system.

Sources and builds are available on AS IS basis without any warranty. Bugs could be filled for JDK 9 EA support into bugzilla with Keyword JDK_9.

Features and UI is still being designed and will change. Don't use these builds for real work! A lot of exceptions ...

NetBeans Jigsaw prototyping goes on in jet-main repository on a branch jdk9. Daily builds are available at http://deadlock.netbeans.org/job/NB-for-JDK9_jigsaw/ with JavaSE build available for download from http://deadlock.netbeans.org/job/NB-for-JDK9_jigsaw/ws/dist/zip/

Getting Started

  1. The NetBeans JDK 9 build runs on top of Java SE 8, you can download the latest update of Java SE 8 here. JDK 7 and older is not supported by NetBeans after NetBeans 8.1 release.
  2. Download the latest JDK 9 Early Access from https://jdk9.java.net/download/ page.
  3. Download NB JDK 9 dev build from http://bits.netbeans.org/download/ or from http://deadlock.netbeans.org/job/NB-for-JDK9_jigsaw/ws/dist/zip/ or build it from sources.
  4. Register the latest JDK 9 EA build as a Java Platform in NetBeans JDK9 build by means of Tools | Java Platforms | Add Platform.

What works

NetBeans JDK 9 builds supports:

  • NB Java SE project support one JDK9/Jigsaw module - Single module project.
  • module-info.java support: editing works and using its statement to set module boundaries for projects
  • All Editing features work according to what is declared in module-info.java
  • Using other NB Java SE Single module projects as libraries (project dependency) is possible
  • Compilation works
  • Run & Debug projects work
  • All other features unrelated to Java language like SCM should work.

What DOES NOT work

At this moment (Feb 23rd, 2016) all features not listed above don't work. Namely:

  • Unit tests support is not yet implemented.
  • Maven projects don't work

How to start

Add JDK9 EA as a Java Platform

image: Jigsaw_J_Platform.png

After adding JDK 9 EA as Java Platform to NetBeans create Jave SE project using New Project wizard. Then add module-info.java. It is available under New File templates in category Java.

image: Jigsaw_New_m-i.j.png

java.base module is by default added to any Jigsaw app. You can now edit module-info.java with requires,...

image: Jigsaw_m-i.j.png

Project can have also dependency on another JDK 9 EA modular (module-info.java) NB project. Use Project Properties | Libraries customizer to add JDK 9 EA project under Modules tab using Add Project... button.

image: Jigsaw_Libs.png


Other Features

Module Dependency Graph

The Graph View of the module-info.java file provides module dependency graph.

image: ModuleGraph.png

Running NetBeans on JDK9 EA as run time Java platform

It is possible to try this NetBeans build run on JDK9 EA build. Use it with care as following command line switches might not be complete. Command lines for running NetBeans JDK 9 branch build on top of JDK9

Linux

 $ bin/netbeans --jdkhome ~/jigsaw_b96 -J-XaddExports:java.desktop/sun.awt=ALL-UNNAMED,java.base/jdk.internal.jrtfs=ALL-UNNAMED,\
java.desktop/java.awt.peer=ALL-UNNAMED,java.desktop/com.sun.beans.editors=ALL-UNNAMED,java.desktop/sun.awt.im=ALL-UNNAMED,\
java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED,java.management/sun.management=ALL-UNNAMED

Mac OSX

 $ bin/netbeans --jdkhome ~/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home -J-XaddExports:java.desktop/com.apple.eawt=ALL-UNNAMED,\
java.desktop/sun.awt=ALL-UNNAMED,java.base/jdk.internal.jrtfs=ALL-UNNAMED,java.desktop/apple.laf=ALL-UNNAMED,java.desktop/java.awt.peer=ALL-UNNAMED,\
java.desktop/com.sun.beans.editors=ALL-UNNAMED,java.desktop/sun.awt.im=ALL-UNNAMED,java.management/sun.management=ALL-UNNAMED 

Windows

 > bin\netbeans.exe --jdkhome C:\jigsaw -J-Djdk.launcher.addexports=java.desktop/sun.awt=ALL-UNNAMED,java.base/jdk.internal.jrtfs=ALL-UNNAMED,
java.desktop/java.awt.peer=ALL-UNNAMED,java.desktop/com.sun.beans.editors=ALL-UNNAMED,java.desktop/sun.awt.im=ALL-UNNAMED,
java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED,java.management/sun.management=ALL-UNNAMED
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