我最近下载了与JavaEE 8兼容的Glassfish 5,现在的问题是,当我尝试创建Java Web Application时,例如我看不到JavaEE 8版本,仅JavaEE 5-7可用。

我的{netbeans_install_path}/etc/netbeans.conf指向JDK 8:

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

如何将JavaEE 8添加到选项中?

最佳答案



NetBeans还没有Java EE 8兼容版本。

NetBeans就像是一个美化的文本编辑器,具有一百万个附加功能,主要是代码生成器。它无法为您自动生成什么,您可以像使用铁杆程序员一样使用记事本编写自己;)选择Java EE 7版本,让Netbeans进行无聊的工作,即自动生成必要的文件,然后手动 编辑所需的部署描述 rune 件中XML schema resources和版本的位置。

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">

10-07 15:23