3

As the title, I cannot add the Glassfish server to NetBeans IDE 14. I pressed the "Add Server..." menu entry, then on the "Choose Server" screen I selected "GlassFish Server". Then, "Not a valid GlassFish Server installation" is shown. I can click the "next" button but the screen does not move on. Anyone know how to fix it? Thank you.

Versions

enter image description here

Java versions

Java version Java class version Java EE Version Glassfish TomEE Tomcat
17 (Java SE 17) 10 (Jakarta EE 10)
13 57
12 56
11 (Java SE 11) 55 10 (Jakarta EE 10)
11 (Java SE 11) 55 9.1 (Jakarta EE 9.1) 6.1
9 53
8 (Java SE 8) 52 9.1 (Jakarta EE 9.1) 6.1
8 (Java SE 8) 52 9 (Jakarta EE 9) 6
8 (Java SE 8) 52 8 (Jakarta EE 8) 5
8 (Java SE 8) 52 8 (Java EE 8) 5
7 (Java SE 7) 7 (Java EE 7) 4
6 (Java SE 6) 6 (Java EE 6) 3
5 (Java SE 5) 5 (Java EE 5)
4 (J2SE 1.4) 4 (J2EE 1.4)
3 (J2SE 1.3) 3 (J2EE 1.3)
2 (J2SE 1.2) 2 (J2EE 1.2)

Research Effort

Bonus Reading

Steps to Reproduce the Problem

Open the project in NetBeans:

enter image description here

So i right-click the project and click Resolve Missing Server Problem...:

enter image description here

Which presets a dialog telling me that i need to add a suitable server instance (whatever servers are, and whatever instances are):

enter image description here

So i click Add Server, where i'm presented with a dialog where i can Choose a server:

enter image description here

I select Glassfish, and click Next, where i'm presented with a dialog where i can choose to download Glassfish:

enter image description here

So i check I have read and accept the license agreement...(click), and click Download Now.... It proceeds to download stuff:

enter image description here

And then it tells me "Not a valid GlassFish server installation":

enter image description here

So i notice a drop-down of Choose server to download:, so i try selecting the 2nd one from the top "GlassFish Server 6.1":

enter image description here

and the re-check the I have read and accept the license agreement...(click)* checkbox, and click Download Now*, but nothing happens:

enter image description here

So i click Back, and then ensure that GlassFish Server is still selected, and click Next:

enter image description here

And now NetBeans simply says Not a valid GlassFish server installation.:

enter image description here

And so i click Next again, and the warning message disappears, but the wizard does not move to the next page:

enter image description here

So i close NetBeans, and delete the C:\Users\Ian\GlassFish_Server folder from my computer:

enter image description here

I then re-launch NetBeans, and repeat the process you see above.

I then created a new Stackoverflow question, and repeated the steps you see above.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219

1 Answers1

3

The steps you followed to add GlassFish look correct, but your environment is invalid.

First, your Help > About screen shot shows that you are running NetBeans 14 using JDK 1.8.0_332, which is unsupported. From the Release Notes for NetBeans 14:

The Apache NetBeans 14 binary releases require JDK 11+, and officially support running on JDK 11 and JDK 17.

Second, from the release documentation for GlassFish 6.1.0:

GlassFish 6.1 will require JDK 11 as a minimum version.

So the only supported platforms when running Glassfish 6.1.0 on NetBeans 14 are JDK 11 and JDK 17.

For my NetBeans 14 installation I edited netbeans.conf to use JDK 11 (netbeans_jdkhome="C:/Java/jdk-11.0.12" in my case), and then restarted NetBeans and downloaded and installed GlassFish 6.1.0 without any problems. FYI, this is what the Properties screen for the GlassFish server looked like:

GlassFish properties

And this is the screen shown when connecting to localhost on port 8080:

localhost:8080

Notes:

  • Though not directly related to your question, I noticed that when viewing the GlassFish admin console (right click the server node and select View Domain Admin Console) on http://localhost:4848/ I just get a blank screen.
  • It's unfortunate that NetBeans even runs on JDK 1.8 since it is not supported. It would be much more helpful to developers if NetBeans refused to start with an error message such as "JDK 1.8 being used. This is not allowed. Use JDK 11 or greater."
  • Be sure to delete any directories created during your unsuccessful attempts to install GlassFish before reinstalling under JDK 11 or JDK 17.
skomisa
  • 16,436
  • 7
  • 61
  • 102
  • https://www.java.com/download/ie_manual.jsp gives me Java 8 (which i ***think*** means Java 1.8). What version of Java does `JDK 11 plus` correspond to? – Ian Boyd Jun 29 '22 at 17:40
  • @IanBoyd [1] Yes, Java 1.8 corresponds to Java 8, but it is also a very old release and unless you have a specific reason to use it you should prefer a newer release of Java. [2] Regardless of that, NetBeans 14 does not support its use; JDK 11 or newer is required. [3] `JDK 11 plus` (or `JDK 11+`) is shorthand for _release JDK 11, or later_. [4] More recent versions of Java are available from https://www.oracle.com/java/technologies/downloads/archive/. [5] [OpenJDK](https://openjdk.org/) is a viable alternative to Oracle for Java releases. – skomisa Jun 29 '22 at 19:03
  • Now that i have acquired Java 18 (1.18?), and extracted it somewhere, how would i configure NetBeans IDE to use that Java 18 1.18 for itself? (while continuing to use Java 8 1.8 for the site i'm trying to build) – Ian Boyd Jun 29 '22 at 19:33
  • 1
    @IanBoyd [1] FYI, Java 18 is not also known as "1.18". That form of (confusing) labeling was discontinued after Java 8/1.8. [2] To configure NetBeans itself to use Java 18 you need to edit the text file **netbeans.conf** which resides in the **etc** directory of your NetBeans 14 installation. See [this SO answer](https://stackoverflow.com/a/54770359/2985643) for full details. [3] Once NetBeans is running on Java 18, open your project's **Properties** window, select **Sources** in the **Categories** column and select _JDK 8_ from the **Source/Binaries Format** drop list, and click **OK**. – skomisa Jun 29 '22 at 20:52
  • @IanBoyd The end result of all that will be: [1] NetBeans will run on Java 18 (not "officially" supported but works fine), and will create Java 18 projects by default. [2] That default can be overridden at the individual project level by setting **Source/Binaries Format**. [3] Because NetBeans will be running on Java 18, when you start GlassFish from NetBeans it will also be running on Java 18, which may be fine, though GlassFish 6.1.0 was released on 5/25/21, before Java 18's release on 3/2/22. [4] If you have problems with GlassFish, consider running NetBeans/GlassFish under Java 11 instead. – skomisa Jun 29 '22 at 21:00