2

Recently we started working on technology upgrade of our system and would like to know if Java 9.0 supported for Glassfish 4.0.

Also I wanted to know if Netbeans 8.X version is having support on Java 9. If so how to configure Java in netbeans? As I see, when I try to configure Java 9, I could not see any jar files loaded.

Please suggest me how to configure Java 9 with Glassfish 4.0 and NetBeans 8.x (To be precise, I am using Netbeans 8.0.2)

enter image description here

Sudhakar Chavali
  • 809
  • 2
  • 14
  • 32

1 Answers1

0

would like to know if Java 9.0 supported for Glassfish 4.0.

Yes, the current version of Glassfish 4.x (4.1.2) will run web applications built using Java 9.

I wanted to know if Netbeans 8.X version is having support on Java 9.

Definitely not. NetBeans 8.x only supports JDK 8 and earlier.

Please suggest me how to configure Java 9 with Glassfish 4.0 and NetBeans 8.x

As mentioned above, you can't use Java 9 with NetBeans 8.x so discard that option. But you can build Java 9 web apps that run on Glassfish 4.x using NetBeans 9 Beta. To do that:

  • Download and install JDK 9.
  • Download and unzip Glassfish 4.1.2
  • Download and unzip Apache NetBeans 9 Beta.
  • Start Apache NetBeans 9 Beta by running netbeans64.exe (or netbeans.exe on 32-bit).
  • Select Tools -> Plugins -> Available Plugins and install everything with a Category of Java Web and EE. NetBeans will restart.
  • Select Tools -> Java Platforms to add JDK 9 as a platform (as shown in the OP).
  • Select the Services tab, right click on the Servers node and select Add Server... from the popup menu.
  • In the Add Server Instance wizard select Glassfish Server and click the Browse... button to navigate to your unzipped installation of Glassfish 4.1.2.
  • From the Services tab start the Glassfish server you just added, and then go to http://localhost:8080 in a broswer to verify that Glassfish 4.1.2 is running OK.
  • Use the File -> New Project... -> Java Web -> Web Application wizard to create a simple web application that is configured to run on the Glassfish server you just added.
  • In the Projects panel select your web project, right click and select Properties.
  • Select Libraries from the Categories list and set Java Platform to JDK 9.
  • Select Sources from the Categories list and set Source/Binary Format to JDK 9. Click OK.
  • In the Projects panel select the web project, right click and select Run. The page for your JDK 9 web app should open in the default browser.

Notes:

  • You can install and use JDK 10 instead of JDK 9 (or as well as JDK 9) on NetBeans 9 Beta.
  • You can freely run NetBeans 9 Beta concurrently with an existing installation of NetBeans 8.x. They are completely separate and will not impact each other.
  • Use the latest version of Glassfish (currently 4.1.2) rather than version 4.0 since a lot of bugs have been fixed.
  • Go to the Apache Netbeans 9 Beta web site for more details.
skomisa
  • 16,436
  • 7
  • 61
  • 102