GlassFish requires a JDK because it does not include one.  One must utilize
a JDK in order to start up GlassFish server.

It sounds like the Maven-based web application is starting up without issue
because in this case GlassFish must be configured to start under a
specified JDK 8 installation (not the one indicated within the NetBeans
project).  Therefore, the project is compiling under the specified JDK in
NetBeans (in this case JDK11) and deploying the resulting WAR file without
issue to the GlassFish server that is running under JDK 8.

I just compiled a Maven WAR under JDK 12 in NetBeans and deployed to
GlassFish 5.1 running on JDK 8.  It seemed to work without issues.


On Tue, Feb 26, 2019 at 8:13 AM Geertjan Wielenga
<geertjan.wiele...@googlemail.com.invalid> wrote:

> OK, nice, in some ways.
>
> What's a bit unfortunate is that one can't select a JDK in the New Project
> wizard for New Web Applications -- whatever JDK is used to start NetBeans
> is assigned to the newly created Java Web application.
>
> The above is true for Ant-based projects and Maven-based projects. Somehow,
> that's ignored in Maven-based projects, which run without a problem on
> GlassFish 5 despite the JDK being JDK 11. So the question comes back to --
> what does GlassFish need the JDK for if it can be ignored, apparently, when
> a Maven-based Web application is able to start up without a problem even
> though it has JDK 11 set? When I look in the POM, there's no reference to
> the JDK, so in the case of Maven projects, it seems relevant to how
> NetBeans supports GlassFish or Java EE, and not a requirement for the Maven
> project to run on GlassFish.
>
> Gj
>
>
> On Tue, Feb 26, 2019 at 3:06 PM Josh Juneau <juneau...@gmail.com> wrote:
>
> > GlassFish 5+ is not currently supported under JDK 9+...that is in the
> > works.  I believe the target JDK is for Java SE 11 support.
> >
> > See this issue in the tracker:
> > https://github.com/eclipse-ee4j/glassfish/issues/22130
> >
> > Therefore, GlassFish 5 requires JDK 8.
> >
> >
> > On Tue, Feb 26, 2019 at 7:59 AM Geertjan Wielenga
> > <geertjan.wiele...@googlemail.com.invalid> wrote:
> >
> > > So, not specifically JDK 8, but greater than JDK 8, too? I.e., the
> > modular
> > > JDK, from JDK 9 onwards, is supported by GlassFish?
> > >
> > > And what does GlassFish need the JDK for?
> > >
> > > Gj
> > >
> > > On Tue, Feb 26, 2019 at 2:57 PM Josh Juneau <juneau...@gmail.com>
> wrote:
> > >
> > > > Hi Geertjan,
> > > >
> > > > Java EE 8 requires JDK8+, and therefore GlassFish 5/5.1 require JDK
> 8+.
> > > >
> > > > Hope this helps.  Thanks
> > > >
> > > > On Tue, Feb 26, 2019 at 7:52 AM Geertjan Wielenga
> > > > <geertjan.wiele...@googlemail.com.invalid> wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > There's quite some functionality in NetBeans related to
> Java/Jakarta
> > EE
> > > > > that assumes that the project is making use of JDK 8.
> > > > >
> > > > > In particular, this results in these problems:
> > > > >
> > > > > https://issues.apache.org/jira/browse/NETBEANS-2170
> > > > > https://issues.apache.org/jira/browse/NETBEANS-2126
> > > > >
> > > > > So, the question is, which if any specific version of the JDK does
> > the
> > > > > latest GlassFish releases require?
> > > > >
> > > > > If GlassFish requires JDK 8, then NetBeans is right and users
> should
> > > > simply
> > > > > be told to use JDK 8 with GlassFish. If not, then we need to change
> > > > > something in NetBeans to enable GlassFish to work with later JDKs.
> > > > >
> > > > > I'm assuming some tools or files in the JDK are needed by GlassFish
> > or,
> > > > at
> > > > > least, are needed by GlassFish when run with/from NetBeans.
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Gj
> > > > >
> > > > --
> > > > Josh Juneau
> > > > juneau...@gmail.com
> > > > http://jj-blogger.blogspot.com
> > > > https://www.apress.com/index.php/author/author/view/id/1866
> > > >
> > >
> > --
> > Josh Juneau
> > juneau...@gmail.com
> > http://jj-blogger.blogspot.com
> > https://www.apress.com/index.php/author/author/view/id/1866
> >
>
-- 
Josh Juneau
juneau...@gmail.com
http://jj-blogger.blogspot.com
https://www.apress.com/index.php/author/author/view/id/1866

Reply via email to