本文介绍了Netbeans如何添加JavaEE版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近下载了符合JavaEE 8标准的Glassfish 5,我现在的问题是当我尝试为例如Java Web应用程序创建Java Web应用程序时我没有看到JavaEE 8版本,只能从JavaEE 5 - 7开始。

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.

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

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

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

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

How do I add JavaEE 8 to the options ?

推荐答案

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

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

NetBeans就像一个美化的文本编辑器,有100万个附加功能,主要是代码生成器。什么它不能为你自动生成,你可以像写一个硬核程序员一样使用Notepad写自己;)只需选择Java EE 7版本,让Netbeans做自动生成必要文件的无聊工作然后手动编辑并在所需的部署描述符文件中自行编译。

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

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

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

这篇关于Netbeans如何添加JavaEE版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 07:09