Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans how to add a JavaEE version?

I recently downloaded Glassfish 5 which is JavaEE 8 compliant, my problem now is that when I try to create a Java Web Application for e.g. I don't see the JavaEE 8 version available, only from JavaEE 5 - 7.

My {netbeans_install_path}/etc/netbeans.conf is pointing to JDK 8:

netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_131"

How do I add JavaEE 8 to the options ?

like image 291
Esteban Rincon Avatar asked Aug 24 '17 02:08

Esteban Rincon


People also ask

Does NetBeans 12.5 work with jdk16?

Apache NetBeans 12.5 runs on JDK LTS releases 8 and 11, with experimental support for JDK 17, i.e., the current JDK release at the time of this NetBeans release. The current JDKs have an issue on macOS Big Sur, that causes freezes on dialogs.

What are Java EE version available in NetBeans?

In the New Project wizard you can choose Java EE 6 Web or Java EE 7 Web as the Java EE version.

Does NetBeans work with JDK 12?

Deployment platformsApache NetBeans 12.0 runs on the JDK LTS releases 8 and 11, as well as on JDK 14, i.e., the current JDK release at the time of this NetBeans release.


2 Answers

Netbeans > File > New Project...

Categories: Maven and Projects: Project from Archetype

Next

Search: javaee8-essentials-archetype

Select the searched entry

Next

and the rest is history.

like image 32
abbas Avatar answered Oct 15 '22 08:10

abbas


How do I add JavaEE 8 to the options ?

NetBeans does not have a Java EE 8 compatible version, yet.

NetBeans is like a glorified text editor with one million additional features, primarily code generators. What it can't autogenerate for you, you can just write yourself as if you were using Notepad like a hardcore programmer ;) Just pick Java EE 7 version, let Netbeans do its boring job of autogenerating the necessary files and then manually edit the location of XML schema resources and versions yourself in the desired deployment descriptor files.

Servlet 4.0 web.xml:

<web-app
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
    version="4.0">

JSF 2.3 faces-config.xml:

<faces-config
    xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd"
    version="2.3">
like image 66
BalusC Avatar answered Oct 15 '22 06:10

BalusC