Netbeans how to add a JavaEE version?

前端 未结 2 1919
轮回少年
轮回少年 2021-02-15 00:22

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 avai

相关标签:
2条回答
  • 2021-02-15 00:45

    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.

    0 讨论(0)
  • 2021-02-15 00:50

    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">
    
    0 讨论(0)
提交回复
热议问题