You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Jaroslav Tulach <ja...@gmail.com> on 2021/02/09 19:18:58 UTC

Let's require NetBeans to be built with JDK11 was: Netbeans Long Term Java Planning

Hi.
I knew the time for a discussion like this is going to come when I wrote my 
"Compile with JDK-11 javac --release flag" in November. I have just been trying 
to find the email in archives, but no luck! I had to resend it. Here is it for 
your reference:

https://lists.apache.org/thread.html/
r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%3Cdev.netbeans.apache.org%3E

I guess I have to agree with Eric, we cannot stick with JDK8 forever. We have 
to move on. On the other hand, as you know, I am not fan of [Big Bang changes]
(http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to move 
forward step by step:

Let's require JDK11 to build NetBeans sources.

The switch to JDK11 compiler doesn't mean I suggest to drop running on JDK8. 
Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8. 
However we can have it and still move our source code base forward where 
needed.

Matthias wrote:
>  I think Jaroslav, said, that in the old time, NetBeans was
> able to be run on JDK-1. I remember that also, but at some point in the
> 8? cycle build requirements jumped to 8, while target version was still
> 1.7.

Yes, that used to be the policy. Even if we restrict the policy to LTS 
versions of Java, JDK17 is near and we have to move forward. As such I wanted 
to discuss this issue in November, 2020. I am still puzzled to understand 
where did my email disappear...

Btw. there is `nb-javac` for JDK8 - related work I am involved in:
https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
This week we managed to make the (automatic) conversion of JDK16's javac to 
run on JDK8 and pass all the available tests.

I really wish NetBeans to continue to run on JDK8, but I am ready to do my 
best to allow you to use the latest Java APIs and features where needed. I 
hope we find a balance between these two desires by going step by step.

As such I repeat my suggestion: let's require JDK11 to build NetBeans:
https://lists.apache.org/thread.html/
r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%3Cdev.netbeans.apache.org%3E


-jt




Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> Question on the Netbeans project's plan for moving forward towards
> introducing and utilizing features with newer Java versions.
> 
> I understand the basic expectations at present are mainly build on Java 8,
> while being possible to build (with applicable flags or jdk settings) for
> newer java versions.
> 
> At what point do we need to take the plunge and start actually using some
> of the new features for Java 9 and beyond?
> 
> When compiling with new java, I see
> 
>    1. references to deprecated or removed interfaces so assume that is one
>    thing that would have to be addressed.
>    2. I see references to "source versions" (I saw one expecting server
>    version 1.4) which also show up.  As I understand it, at some point the
>    general behavior in some of that will be to only support a few jdk
> version back so assume this might be a case for other needed changes [what
> makes it a specific version and is it as simple as changing the source
> version in the project details or build scripts]?
> 
> Assume doing so would require changes like
> 
>    1. Any "JDK" specific build details might have to be addressed
>    2. Address depreciation and source version differences
>    3. Find existing code which are candidates for refactoring with newer
>    java features involved
>    4. Maybe leverage some JDK tools or utilizing netbeans Java "refactoring
>    hints" for suggestions (i.e. changing loops to lambdas, utilized newer
> file interfaces, etc.)
>    5. Any dependency libraries would have to be updated with compatible
>    versions.  This does have the added benefit of utilizing newer versions
> in these as well which may include performance, security, or bug fits
> benefits as well.
>    6. Update any documentation (i.e. build/runtime environments)
> 
> Given the recent javadocs build issues requiring newer jdk, it may mean the
> time is coming sooner rather than later.
> 
> I know this would be a major bit of work but I wanted to raise the question.
> 
> Eric Bresie
> ebresie@gmail.com





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Brett Ryan <br...@gmail.com>.
Unfortunately due to https://issues.apache.org/jira/browse/NETBEANS-6273 we
still need to start NetBeans 12.3 and above on JDK 1.8 due to keyboard
mapping issues. With 12.2 and lower this issue is not present.

On Fri, 1 Oct 2021 at 16:28, Jaroslav Tulach <ja...@gmail.com>
wrote:

> JDK17 is out and Geertjan told me the old request is going to appear again.
> Let me thus review an old thread from November/February...
>
> ---------- Forwarded message ---------
> From: Jaroslav Tulach <ja...@gmail.com>
> Date: Feb 9 2021
>
> Hi.
> I knew the time for a discussion like this is going to come when I wrote my
> "Compile with JDK-11 javac --release flag" in November. I have just been
> trying
> to find the email in archives, but no luck! I had to resend it. Here is it
> for
> your reference:
>
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
> I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
> have
> to move on. On the other hand, as you know, I am not fan of [Big Bang
> changes]
> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
> move
> forward step by step:
>
> Let's require JDK11 to build NetBeans sources.
>
> The switch to JDK11 compiler doesn't mean I suggest to drop running on
> JDK8.
> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
> However we can have it and still move our source code base forward where
> needed.
>
> Matthias wrote:
> >  I think Jaroslav, said, that in the old time, NetBeans was
> > able to be run on JDK-1. I remember that also, but at some point in the
> > 8? cycle build requirements jumped to 8, while target version was still
> > 1.7.
>
> Yes, that used to be the policy. Even if we restrict the policy to LTS
> versions of Java, JDK17 is near and we have to move forward. As such I
> wanted
> to discuss this issue in November, 2020. I am still puzzled to understand
> where did my email disappear...
>
> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> This week we managed to make the (automatic) conversion of JDK16's javac to
> run on JDK8 and pass all the available tests.
>
> I really wish NetBeans to continue to run on JDK8, but I am ready to do my
> best to allow you to use the latest Java APIs and features where needed. I
> hope we find a balance between these two desires by going step by step.
>
> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
>
> -jt
>
>
>
>
>
>
>
> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> > Question on the Netbeans project's plan for moving forward towards
> > introducing and utilizing features with newer Java versions.
> >
> > I understand the basic expectations at present are mainly build on Java
> 8,
> > while being possible to build (with applicable flags or jdk settings) for
> > newer java versions.
> >
> > At what point do we need to take the plunge and start actually using some
> > of the new features for Java 9 and beyond?
> >
> > When compiling with new java, I see
> >
> >    1. references to deprecated or removed interfaces so assume that is
> one
> >    thing that would have to be addressed.
> >    2. I see references to "source versions" (I saw one expecting server
> >    version 1.4) which also show up.  As I understand it, at some point
> the
> >    general behavior in some of that will be to only support a few jdk
> > version back so assume this might be a case for other needed changes
> [what
> > makes it a specific version and is it as simple as changing the source
> > version in the project details or build scripts]?
> >
> > Assume doing so would require changes like
> >
> >    1. Any "JDK" specific build details might have to be addressed
> >    2. Address depreciation and source version differences
> >    3. Find existing code which are candidates for refactoring with newer
> >    java features involved
> >    4. Maybe leverage some JDK tools or utilizing netbeans Java
> "refactoring
> >    hints" for suggestions (i.e. changing loops to lambdas, utilized newer
> > file interfaces, etc.)
> >    5. Any dependency libraries would have to be updated with compatible
> >    versions.  This does have the added benefit of utilizing newer
> versions
> > in these as well which may include performance, security, or bug fits
> > benefits as well.
> >    6. Update any documentation (i.e. build/runtime environments)
> >
> > Given the recent javadocs build issues requiring newer jdk, it may mean
> the
> > time is coming sooner rather than later.
> >
> > I know this would be a major bit of work but I wanted to raise the
> question.
> >
> > Eric Bresie
> > ebresie@gmail.com
>

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
On 04.10.21 15:59, Neil C Smith wrote:
> On Mon, 4 Oct 2021 at 13:31, Michael Bien <mb...@gmail.com> wrote:
>> On 04.10.21 12:38, Neil C Smith wrote:
>>> On Fri, 1 Oct 2021 at 10:08, Neil C Smith <ne...@apache.org> wrote:
>>>> My proposal would be that 12.6 is the last release of Apache NetBeans
>>>> that supports building on JDK 8, ...
>>> Also, I realise the other thing that needs to be considered there if
>>> we're going to do this .. 12.6 is the first release to drop all uses
>>> of JDK 8 for release builds, etc.?  We should probably make sure we're
>>> ready for this on the infrastructure side while we can still fall back
>>> to JDK 8 in an emergency?!
>> it has to be tested on 8, otherwise it will become incompatible fast. My
>> understanding was that the minimum build JDK would be bumped to 11, so
>> that selected 11-only modules can be built, but the requirement to run
>> on 8 is *still* there.
> I'm not sure anyone is saying otherwise right now? (at least for the
> modules that aren't upgraded to 11-only over time).

ok, nevermind then, i just misunderstood - sorry.


> Whether those parts can be tested to the same extent as now is another
> question.  We can't just keep loading on infrastructure.  There will
> need to be consideration of what needs testing where, and how.

yep. The php cluster uses up almost 2h on two nodes per PR push. Most of 
the rest does not look so bad in comparison. Taking a look at the tests 
or making php a conditional build in the workflow (e.g via PR labels*  
or slash commands) would have the potential for big speedups.

* e.g: if: ${{ github.event.label.name == 'php' }} might work

regards,

michael


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Neil C Smith <ne...@apache.org>.
On Mon, 4 Oct 2021 at 13:31, Michael Bien <mb...@gmail.com> wrote:
> On 04.10.21 12:38, Neil C Smith wrote:
> > On Fri, 1 Oct 2021 at 10:08, Neil C Smith <ne...@apache.org> wrote:
> >> My proposal would be that 12.6 is the last release of Apache NetBeans
> >> that supports building on JDK 8, ...
> > Also, I realise the other thing that needs to be considered there if
> > we're going to do this .. 12.6 is the first release to drop all uses
> > of JDK 8 for release builds, etc.?  We should probably make sure we're
> > ready for this on the infrastructure side while we can still fall back
> > to JDK 8 in an emergency?!
>
> it has to be tested on 8, otherwise it will become incompatible fast. My
> understanding was that the minimum build JDK would be bumped to 11, so
> that selected 11-only modules can be built, but the requirement to run
> on 8 is *still* there.

I'm not sure anyone is saying otherwise right now? (at least for the
modules that aren't upgraded to 11-only over time).

Whether those parts can be tested to the same extent as now is another
question.  We can't just keep loading on infrastructure.  There will
need to be consideration of what needs testing where, and how.

The point above is that if we're proposing to drop support for
building on JDK 8 with 13(.0) then we should make sure we're using JDK
11 in 12.6 for all convenience binaries, etc. so that we're sure we're
ready for it.

I'd also point out that ASF releases sources.  More people are voting
based on building those sources with JDK 11 than JDK 8 already.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
On 04.10.21 12:38, Neil C Smith wrote:
> On Fri, 1 Oct 2021 at 10:08, Neil C Smith <ne...@apache.org> wrote:
>> My proposal would be that 12.6 is the last release of Apache NetBeans
>> that supports building on JDK 8, ...
> Also, I realise the other thing that needs to be considered there if
> we're going to do this .. 12.6 is the first release to drop all uses
> of JDK 8 for release builds, etc.?  We should probably make sure we're
> ready for this on the infrastructure side while we can still fall back
> to JDK 8 in an emergency?!


it has to be tested on 8, otherwise it will become incompatible fast. My 
understanding was that the minimum build JDK would be bumped to 11, so 
that selected 11-only modules can be built, but the requirement to run 
on 8 is *still* there.

it might be easier to invert the whole situation and keep building with 
8, but only build/test the selected 11-only modules on 11+ nodes, until 
NB is *actually* able to drop support for 8.

-michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Neil C Smith <ne...@apache.org>.
On Fri, 1 Oct 2021 at 10:08, Neil C Smith <ne...@apache.org> wrote:
> My proposal would be that 12.6 is the last release of Apache NetBeans
> that supports building on JDK 8, ...

Also, I realise the other thing that needs to be considered there if
we're going to do this .. 12.6 is the first release to drop all uses
of JDK 8 for release builds, etc.?  We should probably make sure we're
ready for this on the infrastructure side while we can still fall back
to JDK 8 in an emergency?!

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Neil C Smith <ne...@apache.org>.
On Fri, 1 Oct 2021 at 15:58, Jaroslav Tulach <ja...@gmail.com> wrote:
> My proposal would be that 12.6 is the last release of Apache NetBeans
> > that supports building on JDK 8, and that *officially* supports
> > running on JDK 8.
>
> I think me and my colleagues may need ability to run the NetBeans core code
> on JDK 8 for another year.
...
>
> It would be great if me and my colleagues could continue to contribute to
> the `master` branch. While focus of our team is VSNetBeans frontend, I
> believe we provide a lot of collateral goodness for the whole NetBeans IDE.

Absolutely!  I'm asking whether it's time for the last overall IDE
release that officially supports running on JDK 8?  We keep *as much
as feasible* JDK 8 compatible, and definitely what VSNetBeans
requires, for the foreseeable future.  But yes, needs to be a
balancing act that works for everyone while not overstretching
ourselves! :-)

We already recommend JDK 9+ for the IDE anyway.  It's not a huge step
to say we require JDK 11+ with a note that the IDE may start on JDK 8,
but users should expect a degraded experience?

> > and our requirement (as ASF) to test / track issues
> > in running on JDK 8 is removed,
>
> My proposal suggests to build with JDK-11, but (also) test with JDK-8.
> Certainly we need to run the platform tests on JDK8, we need to run the
> Java editor tests on JDK8 and make sure the results are acceptably good. I
> hope we'll be able to keep/use the existing testing infrastructure for
> running such tests.

I partly meant end user testing / issues.  As in, can we reasonably
expect a sufficient number of users to test on JDK 8 during release
phases?  How much extra work does that create?  Do we treat JDK 8 only
issues (that don't affect VSNetBeans!) with any urgency? etc. etc.

We may need to consider which parts of our automated testing really
needs to continue happening on JDK 8 though (or other JDKs really).
It's also possible we may get some infrastructure issues with JDK 8
over the next year.  And testing capacity is already a pinch point,
particularly during releases, and particularly throwing JDK 17 in the
mix too.

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jaroslav Tulach <ja...@gmail.com>.
My proposal would be that 12.6 is the last release of Apache NetBeans
> that supports building on JDK 8, and that *officially* supports
> running on JDK 8.


I think me and my colleagues may need ability to run the NetBeans core code
on JDK 8 for another year.


> Because we release sources, it would be good if
> possible (it may not be) to keep those two things in sync.
>

It would be great if me and my colleagues could continue to contribute to
the `master` branch. While focus of our team is VSNetBeans frontend, I
believe we provide a lot of collateral goodness for the whole NetBeans IDE.


>
> We do your above proposal (with OpenIDE-Module-Java-Dependencies: Java
> > 11 ) for the foreseeable future.  That proposal was in my mind.  No
> module upgrades without good reason.


+1


> The official Apache IDE release
> should still run on JDK 8, but select features may "drop out" over
> future releases,


Such a decay is understandable and unavoidable. OK.


> and our requirement (as ASF) to test / track issues
> in running on JDK 8 is removed,


My proposal suggests to build with JDK-11, but (also) test with JDK-8.
Certainly we need to run the platform tests on JDK8, we need to run the
Java editor tests on JDK8 and make sure the results are acceptably good. I
hope we'll be able to keep/use the existing testing infrastructure for
running such tests.

-jt

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Neil C Smith <ne...@apache.org>.
On Fri, 1 Oct 2021 at 07:29, Jaroslav Tulach <ja...@gmail.com> wrote:
> yes, using JDK-11 APIs is obviously one of the next steps:
>
> > We should just be prepared, when the
> > first version bumps for release to 11 are requested :-).
>
> It is obviously possible to do that with reflection the way you describe
> below.
> However my preferred way is to use
>
> http://wiki.apidesign.org/wiki/AlternativeImplementation
>
> E.g. slowly start introducing `org.netbeans.modules.xyz.jdk11` modules that
> would register "seams" and spice the default JDK8 behavior on JDK11 with
> additional functionality without the need for reflection.
>
> By setting `java.target=11` in `project.properties` file one instructs the
> NetBeans Harness build system to insert
>
> OpenIDE-Module-Java-Dependencies: Java > 11
>
> into module manifest. Then such module is only going to be enabled on JDK11.

+1 to this.

The reappearance of the old request (as you're aware) is related to a
need to get consensus on a bunch of outstanding points related to
releases before we hit freeze for 12.6 in two weeks.

It's previously been discussed that we drop support for JDK 8 from
release of JDK 17.  Obviously there are problems with doing that,
particularly (but not only) from projects relying on NetBeans as a
base.

My proposal would be that 12.6 is the last release of Apache NetBeans
that supports building on JDK 8, and that *officially* supports
running on JDK 8.  Because we release sources, it would be good if
possible (it may not be) to keep those two things in sync.

We do your above proposal (with OpenIDE-Module-Java-Dependencies: Java
> 11 ) for the foreseeable future.  That proposal was in my mind.  No
module upgrades without good reason.  The official Apache IDE release
should still run on JDK 8, but select features may "drop out" over
future releases, and our requirement (as ASF) to test / track issues
in running on JDK 8 is removed, while still allowing fixes for such
issues to be contributed where necessary.

Does that work?

Best wishes,

Neil

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
i would always vote for remove/replace if it causes so much dependency 
trouble (its "just" a file chooser, right?).

reducing complexity is important, esp for old projects.

-mbien


On 14.01.22 08:26, antonio wrote:
> Hi all,
>
> Regarding the adoption of JDK 11 and the future stragety we want to 
> follow, I have several questions:
>
> 1. Question I: "sun.awt/sun.swing" classes.
>
> We're using sun.awt and sun.swing classes in one "dlight" module we're 
> receiving in the 4th/5th donation. This is because there is an 
> implementation of BasicFileChooser for remote systems. These classes 
> are _not_ exported in the new java.awt.desktop module.
>
> Do we want to:
>
> A) continue using these by adding some "--add-exports" to the build 
> system to gain access to internal module classes?
>
> B) comment/remove this jdk-internal specific features in NetBeans?
>
> C) Use reflection (and possibly an "--add-opens", note this will have 
> an ugly runtime dependency, not a build dependency).
>
> 2. Question II: Builds depend on the compiler, not the runtime.
>
> As Jaroslav points out in his email below, we're using Ant's 
> "<available property/classname" ([2] for reference) in some places [1].
>
> This makes the build dependent on the version of our _compiler_, and 
> not in on the version of our _target runtime_.
>
> Questions are:
>
> A) Is this correct? Do we want the build to depend on the version of 
> our _compiler_?
>
> B) If not, do we want to add a:
>     classpath="${nbjdk.bootclasspath}"
> property to these "available" Ant task so the build system depends on 
> the target runtime?
>
> C) If so, is "nbjdk.bootclasspath" the correct property to use? 
> "nbjdk.home" instead? Is there any other one? Do we want a new 
> property "nb.target.jdk"?
>
>
> Any clarifications most welcome!
>
> Thanks,
> Antonio
>
>
> [1]
> A not exhaustive list:
>
> platform/applemenu:
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/platform/applemenu/build.xml#L26 
>
>
> nbi/engine:
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/nbi/engine/build.xml#L74 
>
>
> platform/openide.util.enumerations:
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/platform/openide.util.enumerations/build.xml#L24 
>
>
> ide/db:
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/ide/db/build.xml#L30 
>
>
>
> [2]
> https://ant.apache.org/manual/Tasks/available.html
>
> El 1/10/21 a las 16:44, Jaroslav Tulach escribió:
>>> I like this proposal in principle.
>>> In case i am missing something - what module would be a candidate for
>>> java.target=11 (as example)?
>>>
>> I see the applemenu module as a really nice example:
>> https://github.com/apache/netbeans/blob/master/platform/applemenu/build.xml#L26 
>>
>> it has two implementations of
>> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapter.java 
>>
>> one is for JDK8 using some external binary Apple classes
>> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK8.java 
>>
>> and the second is using official JDK9 API like `java.awt.desktop.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Eric Bresie <eb...@gmail.com>.
Not really familiar with the usage or code, but don't suppose
BasicFileChooserUI which is in java.desktop serves a similar purpose does
it?

Eric Bresie
ebresie@gmail.com


On Fri, Jan 14, 2022 at 2:49 PM antonio <an...@vieiro.net> wrote:

> Of course not. Otherwise we'd be using the java.desktop APIs :-).
>
> I believe this dependency with sun.swing and sun.awt internals was
> something that was added to NetBeans long ago [1], possibly to solve
> some bugs in JFileChooser in Windows back then.
>
> Cheers,
> Antonio
>
> [1]
>
> https://github.com/emilianbold/netbeans-releases/commit/33b45cbeada48c2b84bcd3283b8ae2366c0b9600#diff-ed4bc55bdf7e65b31bcff39ddde6083c8bc264946964025515b66a036b7ff007
>
>
> El 14/1/22 a las 20:58, Eric Bresie escribió:
> > Are the needed calls available in the java.desktop [1] module and/or the
> > applicable API associated [2] in it?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by antonio <an...@vieiro.net>.
Of course not. Otherwise we'd be using the java.desktop APIs :-).

I believe this dependency with sun.swing and sun.awt internals was 
something that was added to NetBeans long ago [1], possibly to solve 
some bugs in JFileChooser in Windows back then.

Cheers,
Antonio

[1]
https://github.com/emilianbold/netbeans-releases/commit/33b45cbeada48c2b84bcd3283b8ae2366c0b9600#diff-ed4bc55bdf7e65b31bcff39ddde6083c8bc264946964025515b66a036b7ff007


El 14/1/22 a las 20:58, Eric Bresie escribió:
> Are the needed calls available in the java.desktop [1] module and/or the
> applicable API associated [2] in it?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Eric Bresie <eb...@gmail.com>.
I'm sure some of this is a repeat but...

Eric Bresie
ebresie@gmail.com


On Fri, Jan 14, 2022 at 1:26 AM antonio <an...@vieiro.net> wrote:

> Regarding the adoption of JDK 11 and the future stragety we want to
> follow, I have several questions:
>
> 1. Question I: "sun.awt/sun.swing" classes.
>
> We're using sun.awt and sun.swing classes in one "dlight" module we're
> receiving in the 4th/5th donation. This is because there is an
> implementation of BasicFileChooser for remote systems. These classes are
> _not_ exported in the new java.awt.desktop module.
>

Are the needed calls available in the java.desktop [1] module and/or the
applicable API associated [2] in it?


> Do we want to:
>
> A) continue using these by adding some "--add-exports" to the build
> system to gain access to internal module classes?
>
> B) comment/remove this jdk-internal specific features in NetBeans?
>

if I'm not mistaken, I believe that was one of the driving intents of
modularity to move away from internal APIs

From JEP 396 in JDK 16 [3]

   -

   Encourage developers to migrate from using internal elements to using
   standard APIs, so that both they and their users can upgrade without fuss
   to future Java releases.


C) Use reflection (and possibly an "--add-opens", note this will have an
> ugly runtime dependency, not a build dependency).
>

Not immediate concern but I believe there are future plans on updates in
reflections [4] so be aware.

There are plenty of resources for migrating out there [5] [6] [7] [10] [11].

Have to be mindful of API deprecation/removals  [8], like javax.xml which
was deprecated in Java 9 then removed in Java 11

Tried to document some of these sorts of things here [9]

Cheers

References
[1]
http://cr.openjdk.java.net/~iris/se/10/pfd/java-se-10-pfd-spec-01/api/java.desktop-summary.html
[2]
http://cr.openjdk.java.net/~iris/se/10/pfd/java-se-10-pfd-spec-01/api/java/awt/desktop/package-summary.html

[3] http://openjdk.java.net/jeps/396 JEP 396: Strongly Encapsulate JDK
Internals by Default
[4] https://openjdk.java.net/jeps/416
[5] https://www.infogain.com/blog/java-8-to-11-a-migration-story/
[6]
https://stackoverflow.com/questions/60166816/migrating-java-8-project-to-java-11
[7]
https://medium.com/@daniel.panagio18/first-steps-of-migrating-from-java-8-to-java-11-98ea9a5eafff
[8] https://docs.oracle.com/en/java/javase/11/docs/api/deprecated-list.html
[9] https://issues.apache.org/jira/browse/NETBEANS-5349
[10] https://docs.oracle.com/en/java/javase/11/migrate/index.html
[11] https://docs.oracle.com/javase/9/migrate/toc.htm

Re: [DISCUSS] Compiling against internal JDK classes was: Let's require NetBeans to be built with JDK11

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Hi,

Am Samstag, dem 15.01.2022 um 06:03 +0100 schrieb Jaroslav Tulach:
> 
> I am changing the title to discuss usage of JDK internals.
> 
> > 1. Question I: "sun.awt/sun.swing" classes.
> 
> I suggest to avoid using the JDK internals as much as possible. E.g.
> 
> > B) comment/remove this jdk-internal specific features in NetBeans?
> 
> I'd encouraged you to rather create a pull request for OpenJDK project.
> Small changes like https://github.com/openjdk/jdk/pull/3939 have a chance
> to be integrated. Then NetBeans could rely on proper API rather than
> continue to hack around JDK limitations.

we already have the necessary "--add-opens" declarations in place
AWT/Swing is not an area with a lot "lets just remove some classes"
cases. The code from my perspective is mostly set in stone and so save
to use.

Trying to get fixes into the JDK is a noble goal, but not helpful here.
We compile against JDK 11 and test on JDK 8, so newer API are just out.
Until we acknowledge, that people have to use a recent JDK, we have to
fix situations on our side.

Greetings

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Compiling against internal JDK classes was: Let's require NetBeans to be built with JDK11

Posted by Jaroslav Tulach <ja...@gmail.com>.
Hello Antonio,
I am changing the title to discuss usage of JDK internals.

> 1. Question I: "sun.awt/sun.swing" classes.

I suggest to avoid using the JDK internals as much as possible. E.g.

> B) comment/remove this jdk-internal specific features in NetBeans?

I'd encouraged you to rather create a pull request for OpenJDK project.
Small changes like https://github.com/openjdk/jdk/pull/3939 have a chance
to be integrated. Then NetBeans could rely on proper API rather than
continue to hack around JDK limitations.
-jt



pá 14. 1. 2022 v 8:26 odesílatel antonio <an...@vieiro.net> napsal:

> Hi all,
>
> Regarding the adoption of JDK 11 and the future stragety we want to
> follow, I have several questions:
>
> 1. Question I: "sun.awt/sun.swing" classes.
>
> We're using sun.awt and sun.swing classes in one "dlight" module we're
> receiving in the 4th/5th donation. This is because there is an
> implementation of BasicFileChooser for remote systems. These classes are
> _not_ exported in the new java.awt.desktop module.
>
> Do we want to:
>
> A) continue using these by adding some "--add-exports" to the build
> system to gain access to internal module classes?
>
> B) comment/remove this jdk-internal specific features in NetBeans?
>
> C) Use reflection (and possibly an "--add-opens", note this will have an
> ugly runtime dependency, not a build dependency).
>
> 2. Question II: Builds depend on the compiler, not the runtime.
>
> As Jaroslav points out in his email below, we're using Ant's "<available
> property/classname" ([2] for reference) in some places [1].
>
> This makes the build dependent on the version of our _compiler_, and not
> in on the version of our _target runtime_.
>
> Questions are:
>
> A) Is this correct? Do we want the build to depend on the version of our
> _compiler_?
>
> B) If not, do we want to add a:
>         classpath="${nbjdk.bootclasspath}"
> property to these "available" Ant task so the build system depends on
> the target runtime?
>
> C) If so, is "nbjdk.bootclasspath" the correct property to use?
> "nbjdk.home" instead? Is there any other one? Do we want a new property
> "nb.target.jdk"?
>
>
> Any clarifications most welcome!
>
> Thanks,
> Antonio
>
>
> [1]
> A not exhaustive list:
>
> platform/applemenu:
>
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/platform/applemenu/build.xml#L26
>
> nbi/engine:
>
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/nbi/engine/build.xml#L74
>
> platform/openide.util.enumerations:
>
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/platform/openide.util.enumerations/build.xml#L24
>
> ide/db:
>
> https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/ide/db/build.xml#L30
>
>
> [2]
> https://ant.apache.org/manual/Tasks/available.html
>
> El 1/10/21 a las 16:44, Jaroslav Tulach escribió:
> >> I like this proposal in principle.
> >> In case i am missing something - what module would be a candidate for
> >> java.target=11 (as example)?
> >>
> > I see the applemenu module as a really nice example:
> >
> https://github.com/apache/netbeans/blob/master/platform/applemenu/build.xml#L26
> > it has two implementations of
> >
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapter.java
> > one is for JDK8 using some external binary Apple classes
> >
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK8.java
> > and the second is using official JDK9 API like `java.awt.desktop.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by antonio <an...@vieiro.net>.
Hi all,

Regarding the adoption of JDK 11 and the future stragety we want to 
follow, I have several questions:

1. Question I: "sun.awt/sun.swing" classes.

We're using sun.awt and sun.swing classes in one "dlight" module we're 
receiving in the 4th/5th donation. This is because there is an 
implementation of BasicFileChooser for remote systems. These classes are 
_not_ exported in the new java.awt.desktop module.

Do we want to:

A) continue using these by adding some "--add-exports" to the build 
system to gain access to internal module classes?

B) comment/remove this jdk-internal specific features in NetBeans?

C) Use reflection (and possibly an "--add-opens", note this will have an 
ugly runtime dependency, not a build dependency).

2. Question II: Builds depend on the compiler, not the runtime.

As Jaroslav points out in his email below, we're using Ant's "<available 
property/classname" ([2] for reference) in some places [1].

This makes the build dependent on the version of our _compiler_, and not 
in on the version of our _target runtime_.

Questions are:

A) Is this correct? Do we want the build to depend on the version of our 
_compiler_?

B) If not, do we want to add a:
	classpath="${nbjdk.bootclasspath}"
property to these "available" Ant task so the build system depends on 
the target runtime?

C) If so, is "nbjdk.bootclasspath" the correct property to use? 
"nbjdk.home" instead? Is there any other one? Do we want a new property 
"nb.target.jdk"?


Any clarifications most welcome!

Thanks,
Antonio


[1]
A not exhaustive list:

platform/applemenu:
https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/platform/applemenu/build.xml#L26

nbi/engine:
https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/nbi/engine/build.xml#L74

platform/openide.util.enumerations:
https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/platform/openide.util.enumerations/build.xml#L24

ide/db:
https://github.com/apache/netbeans/blob/d2ae8ba167c659458deca4a8cea3177af8450947/ide/db/build.xml#L30


[2]
https://ant.apache.org/manual/Tasks/available.html

El 1/10/21 a las 16:44, Jaroslav Tulach escribió:
>> I like this proposal in principle.
>> In case i am missing something - what module would be a candidate for
>> java.target=11 (as example)?
>>
> I see the applemenu module as a really nice example:
> https://github.com/apache/netbeans/blob/master/platform/applemenu/build.xml#L26
> it has two implementations of
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapter.java
> one is for JDK8 using some external binary Apple classes
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK8.java
> and the second is using official JDK9 API like `java.awt.desktop.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
On 01.10.21 16:44, Jaroslav Tulach wrote:
>> I like this proposal in principle.
>> In case i am missing something - what module would be a candidate for
>> java.target=11 (as example)?
>>
> I see the applemenu module as a really nice example:
> https://github.com/apache/netbeans/blob/master/platform/applemenu/build.xml#L26
> it has two implementations of
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapter.java
> one is for JDK8 using some external binary Apple classes
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK8.java
> and the second is using official JDK9 API like `java.awt.desktop.
> PreferencesEvent`
> https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK9.java
>
> If we could create applemenu.jdk9 module and move all the logic that
> requires JDK9 APIs in there, we would simplify the build scripts. As soon
> as we start building with JDK11, we'll be able to create such module easily
> by setting `javac.target=9`.
> -jt
>
thank you for the links. Yeah this makes sense - it simplifies the 
transition to newer versions. +1

-michael


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jaroslav Tulach <ja...@gmail.com>.
> I like this proposal in principle.

>
> In case i am missing something - what module would be a candidate for
> java.target=11 (as example)?
>

I see the applemenu module as a really nice example:
https://github.com/apache/netbeans/blob/master/platform/applemenu/build.xml#L26
it has two implementations of
https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapter.java
one is for JDK8 using some external binary Apple classes
https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK8.java
and the second is using official JDK9 API like `java.awt.desktop.
PreferencesEvent`
https://github.com/apache/netbeans/blob/master/platform/applemenu/src/org/netbeans/modules/applemenu/NbApplicationAdapterJDK9.java

If we could create applemenu.jdk9 module and move all the logic that
requires JDK9 APIs in there, we would simplify the build scripts. As soon
as we start building with JDK11, we'll be able to create such module easily
by setting `javac.target=9`.
-jt

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Eric Bresie <eb...@gmail.com>.
  1.  In support of this sometime back, I raised this ticket intending to link up related tickets.  Figure I would bring it up in case it helps here
  2.
  3.  NETBEANS-5349<https://issues.apache.org/jira/browse/NETBEANS-5349> Update Netbeans Codebase to Account for deprecated/removed API in Java 11/15

________________________________
From: Michael Bien <mb...@gmail.com>
Sent: Friday, October 1, 2021 7:08 AM
To: dev@netbeans.apache.org; Jaroslav Tulach
Subject: Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

On 01.10.21 08:29, Jaroslav Tulach wrote:
> It is obviously possible to do that with reflection the way you describe
> below.
> However my preferred way is to use
>
> http://wiki.apidesign.org/wiki/AlternativeImplementation
>
> E.g. slowly start introducing `org.netbeans.modules.xyz.jdk11` modules that
> would register "seams" and spice the default JDK8 behavior on JDK11 with
> additional functionality without the need for reflection.
>
> By setting `java.target=11` in `project.properties` file one instructs the
> NetBeans Harness build system to insert
>
> OpenIDE-Module-Java-Dependencies: Java > 11
>
> into module manifest. Then such module is only going to be enabled on JDK11.
I like this proposal in principle. But since it appears that there is
still the requirement to run the platform and the editor features on 8.
This could be basically only set for new modules - everything which is
already there must still work (tested etc) on 8 until 8 is *actually*
dropped.

In case i am missing something - what module would be a candidate for
java.target=11 (as example)?

best regards,

michael



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
On 01.10.21 08:29, Jaroslav Tulach wrote:
> It is obviously possible to do that with reflection the way you describe
> below.
> However my preferred way is to use
>
> http://wiki.apidesign.org/wiki/AlternativeImplementation
>
> E.g. slowly start introducing `org.netbeans.modules.xyz.jdk11` modules that
> would register "seams" and spice the default JDK8 behavior on JDK11 with
> additional functionality without the need for reflection.
>
> By setting `java.target=11` in `project.properties` file one instructs the
> NetBeans Harness build system to insert
>
> OpenIDE-Module-Java-Dependencies: Java > 11
>
> into module manifest. Then such module is only going to be enabled on JDK11.
I like this proposal in principle. But since it appears that there is 
still the requirement to run the platform and the editor features on 8. 
This could be basically only set for new modules - everything which is 
already there must still work (tested etc) on 8 until 8 is *actually* 
dropped.

In case i am missing something - what module would be a candidate for 
java.target=11 (as example)?

best regards,

michael



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jaroslav Tulach <ja...@gmail.com>.
The next message I found in the February thread is this reply to Matthias.
I have even written a [blog post](
http://wiki.apidesign.org/wiki/AlternativeImplementation) at that time!
----

Thanks Matthias,
yes, using JDK-11 APIs is obviously one of the next steps:

> We should just be prepared, when the
> first version bumps for release to 11 are requested :-).

It is obviously possible to do that with reflection the way you describe
below.
However my preferred way is to use

http://wiki.apidesign.org/wiki/AlternativeImplementation

E.g. slowly start introducing `org.netbeans.modules.xyz.jdk11` modules that
would register "seams" and spice the default JDK8 behavior on JDK11 with
additional functionality without the need for reflection.

By setting `java.target=11` in `project.properties` file one instructs the
NetBeans Harness build system to insert

OpenIDE-Module-Java-Dependencies: Java > 11

into module manifest. Then such module is only going to be enabled on JDK11.
-jt


Dne neděle 14. února 2021 16:24:37 CET, Matthias Bläsing napsal(a):
> Hi Jaroslav,
>
> I like the general idea. Using release where possible should give us a
> higher ensurance not to create unusable builds.
>
> I can imaging where it might be interesting to build a class file for
> an older bytecode level, but still against a current API: If the usage
> of the new API is propertly behind version checks, then the module
> could use newer API on newer JDKs, but retain compatibility with older
> JDKs. Having said this, I also thing this is a corner case and if
> necessary we can still switch over. If I also remember correctly,
> MethodHandles should give us room to implement reflection like access
> with the speed of bytecode invocation, so it might not even be worth
> it.
>
>
> I also think requiring JDK 9+ to compile NetBeans (effectively meaning
> 11) is ok at this point in time. We should just be prepared, when the
> first version bumps for release to 11 are requested :-).
>
> Greetings
>
> Matthias


pá 1. 10. 2021 v 8:27 odesílatel Jaroslav Tulach <ja...@gmail.com>
napsal:

> JDK17 is out and Geertjan told me the old request is going to appear
> again. Let me thus review an old thread from November/February...
>
> ---------- Forwarded message ---------
> From: Jaroslav Tulach <ja...@gmail.com>
> Date: Feb 9 2021
>
> Hi.
> I knew the time for a discussion like this is going to come when I wrote
> my
> "Compile with JDK-11 javac --release flag" in November. I have just been
> trying
> to find the email in archives, but no luck! I had to resend it. Here is it
> for
> your reference:
>
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
> I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
> have
> to move on. On the other hand, as you know, I am not fan of [Big Bang
> changes]
> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
> move
> forward step by step:
>
> Let's require JDK11 to build NetBeans sources.
>
> The switch to JDK11 compiler doesn't mean I suggest to drop running on
> JDK8.
> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
> However we can have it and still move our source code base forward where
> needed.
>
> Matthias wrote:
> >  I think Jaroslav, said, that in the old time, NetBeans was
> > able to be run on JDK-1. I remember that also, but at some point in the
> > 8? cycle build requirements jumped to 8, while target version was still
> > 1.7.
>
> Yes, that used to be the policy. Even if we restrict the policy to LTS
> versions of Java, JDK17 is near and we have to move forward. As such I
> wanted
> to discuss this issue in November, 2020. I am still puzzled to understand
> where did my email disappear...
>
> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> This week we managed to make the (automatic) conversion of JDK16's javac
> to
> run on JDK8 and pass all the available tests.
>
> I really wish NetBeans to continue to run on JDK8, but I am ready to do my
> best to allow you to use the latest Java APIs and features where needed. I
> hope we find a balance between these two desires by going step by step.
>
> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
>
> -jt
>
>
>
>
>
>
>
> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> > Question on the Netbeans project's plan for moving forward towards
> > introducing and utilizing features with newer Java versions.
> >
> > I understand the basic expectations at present are mainly build on Java
> 8,
> > while being possible to build (with applicable flags or jdk settings) for
> > newer java versions.
> >
> > At what point do we need to take the plunge and start actually using some
> > of the new features for Java 9 and beyond?
> >
> > When compiling with new java, I see
> >
> >    1. references to deprecated or removed interfaces so assume that is
> one
> >    thing that would have to be addressed.
> >    2. I see references to "source versions" (I saw one expecting server
> >    version 1.4) which also show up.  As I understand it, at some point
> the
> >    general behavior in some of that will be to only support a few jdk
> > version back so assume this might be a case for other needed changes
> [what
> > makes it a specific version and is it as simple as changing the source
> > version in the project details or build scripts]?
> >
> > Assume doing so would require changes like
> >
> >    1. Any "JDK" specific build details might have to be addressed
> >    2. Address depreciation and source version differences
> >    3. Find existing code which are candidates for refactoring with newer
> >    java features involved
> >    4. Maybe leverage some JDK tools or utilizing netbeans Java
> "refactoring
> >    hints" for suggestions (i.e. changing loops to lambdas, utilized newer
> > file interfaces, etc.)
> >    5. Any dependency libraries would have to be updated with compatible
> >    versions.  This does have the added benefit of utilizing newer
> versions
> > in these as well which may include performance, security, or bug fits
> > benefits as well.
> >    6. Update any documentation (i.e. build/runtime environments)
> >
> > Given the recent javadocs build issues requiring newer jdk, it may mean
> the
> > time is coming sooner rather than later.
> >
> > I know this would be a major bit of work but I wanted to raise the
> question.
> >
> > Eric Bresie
> > ebresie@gmail.com
>
>
>
>
>

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Eric Bresie <eb...@gmail.com>.
Really wasn’t expecting the frgaal comment to provide so much discussion.

I was more concerned about other aspects of my comments
(target/source/release, multi jars, deprecated/removed apis).

On Sat, Oct 9, 2021 at 12:00 PM Jeremy Cavanagh <je...@orange.fr>
wrote:

> Hi,
>
> Just felt I wanted to add my two pence worth, hopefully, without
> upsetting anyone.
>
> As far as I can see frgaal doesn't offer anything to us. It's main
> purpose appears to be allowing users who are, for want of a better term,
> *stuck* with JDK1.8 but would like to try some newer language features
> without making a large and possibly risky investment in moving up the
> JDK levels.
>
> If that is the case how likely are any of them going to be interested in
> updated NetBeans IDEs. Do the newest versions offer those users anything
> that they don't already have?
>
> If they aren't likely to change, why not, take the bull by the horns,
> and say that after 12.6 all future versions will be built to support all
> of the features of JDK17 the latest LTS version. I don't see the point
> at stopping at JDK11.
>
> Adopting JDK17 will give you a longer time to work on the IDE with the
> latest LTS version which does offer many interesting features that the
> NetBeans IDE could benefit from.
>
> Then the NB versions <= 12.6 will only be bug fixed from proper requests
> and no new features would be added. Anyone using JDKs > 1.8 should be
> encouraged to use the latest versions of NetBeans.
>
> Well it's just a thought. But, you should try and get ahead of the game
> because the same discussion will happen again "why don't we stop
> supporting JDK11 and move to JDK17...".
>
> Regards to all,
>
> Jeremy
>
> On 09/10/2021 18:06, Ernie Rael wrote:
> > Brought up fraagl to allow "any/all jdk-11 language features" NOT APIs;
> > fraagl can compile new language features to only JDK 8 bytecodes. Then
> > the ubiquitous JDK 8 runtime can still be used.
> >
> > The issues around APIs are discussed in the "[LAZY CONSENSUS] Drop
> > support for building (and officially running) on JDK 8 ..." thread and
> > elsewhere.
> >
> > -ernie
> >
> > On 10/9/2021 8:38 AM, Eric Bresie wrote:
>
> >>
> >> Is this maybe a matter relating to release/source/target/bootclasspath
> >> (2)
> >> aspects of things?
> >>
> >> Would multiple release jars (3) be needed as part of this?  Then version
> >> specific items can be added in applicable namespace and compiled for
> >> given
> >> releases as needed (i.e. build steps for each supported java release
> >> version)?  In theory it might bloat things a little but it would extend
> >> compatibility with older java for a little longer.
> >>
> >> Assume some of this would be considered during CI build pipeline as
> where
> >> somewhere.
> >>
> >> So from a higher level…
> >> * There is netbeans source code
> >> ** may/may not use newer java version APIs.
> >> ** If there are new java API features used (i.e. modules, block quotes,
> >> records, etc.) this adds a dependency on the given java version
> >> introduced
> >> during compile time
> >> ** If present but used on an older version would need to bridge
> >> between it
> >> (i.e. if supported use it if not then need to either have a wrapper,
> >> “adapter” [frgaal] means of leveraging new in an old environment, or
> >> multi
> >> release jar]
> >>
> >> * There is the java used to compile netbeans
> >> ** Used to compile to byte code of a specific version
> >> ** Possible to compile to older release versions
> >> ** May be impacting of release/source/target/bootclasspath build/run
> >> settings
> >>
> >> * There is the java used to run
> >> ** As long as compiled to be compatible with a specific release
> >> version it
> >> should run.
> >> ** If not compiled to be compatible, it doesn’t run (i.e. bytecode
> >> compatibility issue, unavailable APIs, etc.)
> >> ** My require “bridging”/“adapting” [frgaal] to run on
> >>
> >> * There is the java used to compile the [external] dependencies
> >> ** Each external dependency has its own java compatible version and may
> >> require updated dependencies (i.e. if using dependency not compiled it
> >> may
> >> work but if something calls from external back, there is a chance it may
> >> not be compatible due to conflicting java versions)
> >>
> >> Eric
> >>
> >> References
> >> (1) http://frgaal.org/
> >> (2)
> >>
> https://stackoverflow.com/questions/43102787/what-is-the-release-flag-in-the-java-9-compiler
> >>
> >> (3) https://nipafx.dev/multi-release-jars-multiple-java-versions/
> >>
> >> On Thu, Oct 7, 2021 at 12:58 AM Jaroslav Tulach
> >> <ja...@gmail.com>
> >> wrote:
> >>
> >>> Dne sobota 2. října 2021 1:38:20 CEST, Ernie Rael napsal(a):
> >>>> frgaal?
> >>>>
> >>>> How about allowing any/all jdk-11 language features and if a developer
> >>>> needs to run on jdk8 they must use frgaal to compile NB for jdk8?
> >>> Frgaal, that'd be fantastic! As far as I know the latest version
> >>> supports
> >>> all
> >>> JDK16 features including records. Fellow developers could code with the
> >>> newest
> >>> language features, while still target JDK8 APIs and bytecode version.
> >>>
> >>> Anyway, let's go step by step. Using JDK-11 to compile NetBeans seems
> to
> >>> have
> >>> overall support and seems to be moving in the right direction.
> >>> -jt
> >>>
> >>> PS: Ernie, if you decide to enable Frgaal compilation (see PR-2369 for
> >>> inspiration), you'll get my support.
> >>>
> >>>> On 9/30/2021 11:27 PM, Jaroslav Tulach wrote:
> >>>>> JDK17 is out and Geertjan told me the old request is going to appear
> >>>>> again.
> >>>>> Let me thus review an old thread from November/February...
> >>>>>
> >>>>> ---------- Forwarded message ---------
> >>>>> From: Jaroslav Tulach <ja...@gmail.com>
> >>>>> Date: Feb 9 2021
> >>>>>
> >>>>> Hi.
> >>>>> I knew the time for a discussion like this is going to come when I
> >>> wrote
> >>>>> my
> >>>>> "Compile with JDK-11 javac --release flag" in November. I have just
> >>> been
> >>>>> trying
> >>>>> to find the email in archives, but no luck! I had to resend it. Here
> >>> is it
> >>>>> for
> >>>>> your reference:
> >>>>>
> >>>>> https://lists.apache.org/thread.html/
> >>>>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> >>>>> 3Cdev.netbeans.apache.org%3E
> >>>>>
> >>>>> I guess I have to agree with Eric, we cannot stick with JDK8 forever.
> >>> We
> >>>>> have
> >>>>> to move on. On the other hand, as you know, I am not fan of [Big Bang
> >>>>> changes]
> >>>>> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to
> >>> propose to
> >>>>> move
> >>>>> forward step by step:
> >>>>>
> >>>>> Let's require JDK11 to build NetBeans sources.
> >>>>>
> >>>>> The switch to JDK11 compiler doesn't mean I suggest to drop running
> on
> >>>>> JDK8.
> >>>>> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on
> >>>>> JDK8.
> >>>>> However we can have it and still move our source code base forward
> >>> where
> >>>>> needed.
> >>>>>
> >>>>> Matthias wrote:
> >>>>>>    I think Jaroslav, said, that in the old time, NetBeans was
> >>>>>>
> >>>>>> able to be run on JDK-1. I remember that also, but at some point in
> >>> the
> >>>>>> 8? cycle build requirements jumped to 8, while target version was
> >>> still
> >>>>>> 1.7.
> >>>>> Yes, that used to be the policy. Even if we restrict the policy to
> LTS
> >>>>> versions of Java, JDK17 is near and we have to move forward. As such
> I
> >>>>> wanted
> >>>>> to discuss this issue in November, 2020. I am still puzzled to
> >>> understand
> >>>>> where did my email disappear...
> >>>>>
> >>>>> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> >>>>>
> >>>
> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> >>>
> >>>>> This week we managed to make the (automatic) conversion of JDK16's
> >>> javac
> >>>>> to
> >>>>> run on JDK8 and pass all the available tests.
> >>>>>
> >>>>> I really wish NetBeans to continue to run on JDK8, but I am ready to
> >>> do my
> >>>>> best to allow you to use the latest Java APIs and features where
> >>> needed. I
> >>>>> hope we find a balance between these two desires by going step by
> >>>>> step.
> >>>>>
> >>>>> As such I repeat my suggestion: let's require JDK11 to build
> NetBeans:
> >>>>> https://lists.apache.org/thread.html/
> >>>>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> >>>>> 3Cdev.netbeans.apache.org%3E
> >>>>>
> >>>>>
> >>>>> -jt
> >>>>>
> >>>>> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> >>>>>> Question on the Netbeans project's plan for moving forward towards
> >>>>>> introducing and utilizing features with newer Java versions.
> >>>>>>
> >>>>>> I understand the basic expectations at present are mainly build on
> >>> Java
> >>>>>> 8,
> >>>>>> while being possible to build (with applicable flags or jdk
> settings)
> >>> for
> >>>>>> newer java versions.
> >>>>>>
> >>>>>> At what point do we need to take the plunge and start actually using
> >>> some
> >>>>>> of the new features for Java 9 and beyond?
> >>>>>>
> >>>>>> When compiling with new java, I see
> >>>>>>
> >>>>>>      1. references to deprecated or removed interfaces so assume
> that
> >>> is
> >>>>>>      one
> >>>>>>      thing that would have to be addressed.
> >>>>>>      2. I see references to "source versions" (I saw one expecting
> >>> server
> >>>>>>      version 1.4) which also show up.  As I understand it, at some
> >>> point
> >>>>>>      the
> >>>>>>      general behavior in some of that will be to only support a
> >>>>>> few jdk
> >>>>>>
> >>>>>> version back so assume this might be a case for other needed changes
> >>>>>> [what
> >>>>>> makes it a specific version and is it as simple as changing the
> >>>>>> source
> >>>>>> version in the project details or build scripts]?
> >>>>>>
> >>>>>> Assume doing so would require changes like
> >>>>>>
> >>>>>>      1. Any "JDK" specific build details might have to be addressed
> >>>>>>      2. Address depreciation and source version differences
> >>>>>>      3. Find existing code which are candidates for refactoring with
> >>> newer
> >>>>>>      java features involved
> >>>>>>      4. Maybe leverage some JDK tools or utilizing netbeans Java
> >>>>> "refactoring
> >>>>>
> >>>>>>      hints" for suggestions (i.e. changing loops to lambdas,
> utilized
> >>>>>>      newer
> >>>>>>
> >>>>>> file interfaces, etc.)
> >>>>>>
> >>>>>>      5. Any dependency libraries would have to be updated with
> >>> compatible
> >>>>>>      versions.  This does have the added benefit of utilizing newer
> >>>>>>      versions
> >>>>>>
> >>>>>> in these as well which may include performance, security, or bug
> fits
> >>>>>> benefits as well.
> >>>>>>
> >>>>>>      6. Update any documentation (i.e. build/runtime environments)
> >>>>>>
> >>>>>> Given the recent javadocs build issues requiring newer jdk, it may
> >>> mean
> >>>>> the
> >>>>>
> >>>>>> time is coming sooner rather than later.
> >>>>>>
> >>>>>> I know this would be a major bit of work but I wanted to raise the
> >>>>> question.
> >>>>>
> >>>>>> Eric Bresie
> >>>>>> ebresie@gmail.com
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >>>> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>>>
> >>>> For further information about the NetBeans mailing lists, visit:
> >>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>>
> >>>
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> >>> For additional commands, e-mail: dev-help@netbeans.apache.org
> >>>
> >>> For further information about the NetBeans mailing lists, visit:
> >>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >>>
> >>>
> >>>
> >>> --
> >> Eric Bresie
> >> ebresie@gmail.com
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
> --
Eric Bresie
ebresie@gmail.com

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jeremy Cavanagh <je...@orange.fr>.
Hi,

Just felt I wanted to add my two pence worth, hopefully, without 
upsetting anyone.

As far as I can see frgaal doesn't offer anything to us. It's main 
purpose appears to be allowing users who are, for want of a better term, 
*stuck* with JDK1.8 but would like to try some newer language features 
without making a large and possibly risky investment in moving up the 
JDK levels.

If that is the case how likely are any of them going to be interested in 
updated NetBeans IDEs. Do the newest versions offer those users anything 
that they don't already have?

If they aren't likely to change, why not, take the bull by the horns, 
and say that after 12.6 all future versions will be built to support all 
of the features of JDK17 the latest LTS version. I don't see the point 
at stopping at JDK11.

Adopting JDK17 will give you a longer time to work on the IDE with the 
latest LTS version which does offer many interesting features that the 
NetBeans IDE could benefit from.

Then the NB versions <= 12.6 will only be bug fixed from proper requests 
and no new features would be added. Anyone using JDKs > 1.8 should be 
encouraged to use the latest versions of NetBeans.

Well it's just a thought. But, you should try and get ahead of the game 
because the same discussion will happen again "why don't we stop 
supporting JDK11 and move to JDK17...".

Regards to all,

Jeremy

On 09/10/2021 18:06, Ernie Rael wrote:
> Brought up fraagl to allow "any/all jdk-11 language features" NOT APIs; 
> fraagl can compile new language features to only JDK 8 bytecodes. Then 
> the ubiquitous JDK 8 runtime can still be used.
> 
> The issues around APIs are discussed in the "[LAZY CONSENSUS] Drop 
> support for building (and officially running) on JDK 8 ..." thread and 
> elsewhere.
> 
> -ernie
> 
> On 10/9/2021 8:38 AM, Eric Bresie wrote:
>> Frgaal (1) does seem an interesting beast.  How would that work?  
>> Netbeans
>> would be compiled using frgaal to support newer features to be still 
>> usable
>> on Java 8?  Would that in someway have to be targeted (i.e. compiled to a
>> specific release target) which would adapter for use on java 8?  Does 
>> that
>> mean full later java features would have some kind of bridge layer?  
>> Would
>> that impact performance in any way?
>>
>> Is this maybe a matter relating to release/source/target/bootclasspath 
>> (2)
>> aspects of things?
>>
>> Would multiple release jars (3) be needed as part of this?  Then version
>> specific items can be added in applicable namespace and compiled for 
>> given
>> releases as needed (i.e. build steps for each supported java release
>> version)?  In theory it might bloat things a little but it would extend
>> compatibility with older java for a little longer.
>>
>> Assume some of this would be considered during CI build pipeline as where
>> somewhere.
>>
>> So from a higher level…
>> * There is netbeans source code
>> ** may/may not use newer java version APIs.
>> ** If there are new java API features used (i.e. modules, block quotes,
>> records, etc.) this adds a dependency on the given java version 
>> introduced
>> during compile time
>> ** If present but used on an older version would need to bridge 
>> between it
>> (i.e. if supported use it if not then need to either have a wrapper,
>> “adapter” [frgaal] means of leveraging new in an old environment, or 
>> multi
>> release jar]
>>
>> * There is the java used to compile netbeans
>> ** Used to compile to byte code of a specific version
>> ** Possible to compile to older release versions
>> ** May be impacting of release/source/target/bootclasspath build/run
>> settings
>>
>> * There is the java used to run
>> ** As long as compiled to be compatible with a specific release 
>> version it
>> should run.
>> ** If not compiled to be compatible, it doesn’t run (i.e. bytecode
>> compatibility issue, unavailable APIs, etc.)
>> ** My require “bridging”/“adapting” [frgaal] to run on
>>
>> * There is the java used to compile the [external] dependencies
>> ** Each external dependency has its own java compatible version and may
>> require updated dependencies (i.e. if using dependency not compiled it 
>> may
>> work but if something calls from external back, there is a chance it may
>> not be compatible due to conflicting java versions)
>>
>> Eric
>>
>> References
>> (1) http://frgaal.org/
>> (2)
>> https://stackoverflow.com/questions/43102787/what-is-the-release-flag-in-the-java-9-compiler 
>>
>> (3) https://nipafx.dev/multi-release-jars-multiple-java-versions/
>>
>> On Thu, Oct 7, 2021 at 12:58 AM Jaroslav Tulach 
>> <ja...@gmail.com>
>> wrote:
>>
>>> Dne sobota 2. října 2021 1:38:20 CEST, Ernie Rael napsal(a):
>>>> frgaal?
>>>>
>>>> How about allowing any/all jdk-11 language features and if a developer
>>>> needs to run on jdk8 they must use frgaal to compile NB for jdk8?
>>> Frgaal, that'd be fantastic! As far as I know the latest version 
>>> supports
>>> all
>>> JDK16 features including records. Fellow developers could code with the
>>> newest
>>> language features, while still target JDK8 APIs and bytecode version.
>>>
>>> Anyway, let's go step by step. Using JDK-11 to compile NetBeans seems to
>>> have
>>> overall support and seems to be moving in the right direction.
>>> -jt
>>>
>>> PS: Ernie, if you decide to enable Frgaal compilation (see PR-2369 for
>>> inspiration), you'll get my support.
>>>
>>>> On 9/30/2021 11:27 PM, Jaroslav Tulach wrote:
>>>>> JDK17 is out and Geertjan told me the old request is going to appear
>>>>> again.
>>>>> Let me thus review an old thread from November/February...
>>>>>
>>>>> ---------- Forwarded message ---------
>>>>> From: Jaroslav Tulach <ja...@gmail.com>
>>>>> Date: Feb 9 2021
>>>>>
>>>>> Hi.
>>>>> I knew the time for a discussion like this is going to come when I
>>> wrote
>>>>> my
>>>>> "Compile with JDK-11 javac --release flag" in November. I have just
>>> been
>>>>> trying
>>>>> to find the email in archives, but no luck! I had to resend it. Here
>>> is it
>>>>> for
>>>>> your reference:
>>>>>
>>>>> https://lists.apache.org/thread.html/
>>>>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
>>>>> 3Cdev.netbeans.apache.org%3E
>>>>>
>>>>> I guess I have to agree with Eric, we cannot stick with JDK8 forever.
>>> We
>>>>> have
>>>>> to move on. On the other hand, as you know, I am not fan of [Big Bang
>>>>> changes]
>>>>> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to
>>> propose to
>>>>> move
>>>>> forward step by step:
>>>>>
>>>>> Let's require JDK11 to build NetBeans sources.
>>>>>
>>>>> The switch to JDK11 compiler doesn't mean I suggest to drop running on
>>>>> JDK8.
>>>>> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on 
>>>>> JDK8.
>>>>> However we can have it and still move our source code base forward
>>> where
>>>>> needed.
>>>>>
>>>>> Matthias wrote:
>>>>>>    I think Jaroslav, said, that in the old time, NetBeans was
>>>>>>
>>>>>> able to be run on JDK-1. I remember that also, but at some point in
>>> the
>>>>>> 8? cycle build requirements jumped to 8, while target version was
>>> still
>>>>>> 1.7.
>>>>> Yes, that used to be the policy. Even if we restrict the policy to LTS
>>>>> versions of Java, JDK17 is near and we have to move forward. As such I
>>>>> wanted
>>>>> to discuss this issue in November, 2020. I am still puzzled to
>>> understand
>>>>> where did my email disappear...
>>>>>
>>>>> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
>>>>>
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac 
>>>
>>>>> This week we managed to make the (automatic) conversion of JDK16's
>>> javac
>>>>> to
>>>>> run on JDK8 and pass all the available tests.
>>>>>
>>>>> I really wish NetBeans to continue to run on JDK8, but I am ready to
>>> do my
>>>>> best to allow you to use the latest Java APIs and features where
>>> needed. I
>>>>> hope we find a balance between these two desires by going step by 
>>>>> step.
>>>>>
>>>>> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
>>>>> https://lists.apache.org/thread.html/
>>>>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
>>>>> 3Cdev.netbeans.apache.org%3E
>>>>>
>>>>>
>>>>> -jt
>>>>>
>>>>> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
>>>>>> Question on the Netbeans project's plan for moving forward towards
>>>>>> introducing and utilizing features with newer Java versions.
>>>>>>
>>>>>> I understand the basic expectations at present are mainly build on
>>> Java
>>>>>> 8,
>>>>>> while being possible to build (with applicable flags or jdk settings)
>>> for
>>>>>> newer java versions.
>>>>>>
>>>>>> At what point do we need to take the plunge and start actually using
>>> some
>>>>>> of the new features for Java 9 and beyond?
>>>>>>
>>>>>> When compiling with new java, I see
>>>>>>
>>>>>>      1. references to deprecated or removed interfaces so assume that
>>> is
>>>>>>      one
>>>>>>      thing that would have to be addressed.
>>>>>>      2. I see references to "source versions" (I saw one expecting
>>> server
>>>>>>      version 1.4) which also show up.  As I understand it, at some
>>> point
>>>>>>      the
>>>>>>      general behavior in some of that will be to only support a 
>>>>>> few jdk
>>>>>>
>>>>>> version back so assume this might be a case for other needed changes
>>>>>> [what
>>>>>> makes it a specific version and is it as simple as changing the 
>>>>>> source
>>>>>> version in the project details or build scripts]?
>>>>>>
>>>>>> Assume doing so would require changes like
>>>>>>
>>>>>>      1. Any "JDK" specific build details might have to be addressed
>>>>>>      2. Address depreciation and source version differences
>>>>>>      3. Find existing code which are candidates for refactoring with
>>> newer
>>>>>>      java features involved
>>>>>>      4. Maybe leverage some JDK tools or utilizing netbeans Java
>>>>> "refactoring
>>>>>
>>>>>>      hints" for suggestions (i.e. changing loops to lambdas, utilized
>>>>>>      newer
>>>>>>
>>>>>> file interfaces, etc.)
>>>>>>
>>>>>>      5. Any dependency libraries would have to be updated with
>>> compatible
>>>>>>      versions.  This does have the added benefit of utilizing newer
>>>>>>      versions
>>>>>>
>>>>>> in these as well which may include performance, security, or bug fits
>>>>>> benefits as well.
>>>>>>
>>>>>>      6. Update any documentation (i.e. build/runtime environments)
>>>>>>
>>>>>> Given the recent javadocs build issues requiring newer jdk, it may
>>> mean
>>>>> the
>>>>>
>>>>>> time is coming sooner rather than later.
>>>>>>
>>>>>> I know this would be a major bit of work but I wanted to raise the
>>>>> question.
>>>>>
>>>>>> Eric Bresie
>>>>>> ebresie@gmail.com
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>>
>>>> For further information about the NetBeans mailing lists, visit:
>>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>>
>>>
>>>
>>> -- 
>> Eric Bresie
>> ebresie@gmail.com
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Ernie Rael <er...@raelity.com>.
Brought up fraagl to allow "any/all jdk-11 language features" NOT APIs; 
fraagl can compile new language features to only JDK 8 bytecodes. Then 
the ubiquitous JDK 8 runtime can still be used.

The issues around APIs are discussed in the "[LAZY CONSENSUS] Drop 
support for building (and officially running) on JDK 8 ..." thread and 
elsewhere.

-ernie

On 10/9/2021 8:38 AM, Eric Bresie wrote:
> Frgaal (1) does seem an interesting beast.  How would that work?  Netbeans
> would be compiled using frgaal to support newer features to be still usable
> on Java 8?  Would that in someway have to be targeted (i.e. compiled to a
> specific release target) which would adapter for use on java 8?  Does that
> mean full later java features would have some kind of bridge layer?  Would
> that impact performance in any way?
>
> Is this maybe a matter relating to release/source/target/bootclasspath (2)
> aspects of things?
>
> Would multiple release jars (3) be needed as part of this?  Then version
> specific items can be added in applicable namespace and compiled for given
> releases as needed (i.e. build steps for each supported java release
> version)?  In theory it might bloat things a little but it would extend
> compatibility with older java for a little longer.
>
> Assume some of this would be considered during CI build pipeline as where
> somewhere.
>
> So from a higher level…
> * There is netbeans source code
> ** may/may not use newer java version APIs.
> ** If there are new java API features used (i.e. modules, block quotes,
> records, etc.) this adds a dependency on the given java version introduced
> during compile time
> ** If present but used on an older version would need to bridge between it
> (i.e. if supported use it if not then need to either have a wrapper,
> “adapter” [frgaal] means of leveraging new in an old environment, or multi
> release jar]
>
> * There is the java used to compile netbeans
> ** Used to compile to byte code of a specific version
> ** Possible to compile to older release versions
> ** May be impacting of release/source/target/bootclasspath build/run
> settings
>
> * There is the java used to run
> ** As long as compiled to be compatible with a specific release version it
> should run.
> ** If not compiled to be compatible, it doesn’t run (i.e. bytecode
> compatibility issue, unavailable APIs, etc.)
> ** My require “bridging”/“adapting” [frgaal] to run on
>
> * There is the java used to compile the [external] dependencies
> ** Each external dependency has its own java compatible version and may
> require updated dependencies (i.e. if using dependency not compiled it may
> work but if something calls from external back, there is a chance it may
> not be compatible due to conflicting java versions)
>
> Eric
>
> References
> (1) http://frgaal.org/
> (2)
> https://stackoverflow.com/questions/43102787/what-is-the-release-flag-in-the-java-9-compiler
> (3) https://nipafx.dev/multi-release-jars-multiple-java-versions/
>
> On Thu, Oct 7, 2021 at 12:58 AM Jaroslav Tulach <ja...@gmail.com>
> wrote:
>
>> Dne sobota 2. října 2021 1:38:20 CEST, Ernie Rael napsal(a):
>>> frgaal?
>>>
>>> How about allowing any/all jdk-11 language features and if a developer
>>> needs to run on jdk8 they must use frgaal to compile NB for jdk8?
>> Frgaal, that'd be fantastic! As far as I know the latest version supports
>> all
>> JDK16 features including records. Fellow developers could code with the
>> newest
>> language features, while still target JDK8 APIs and bytecode version.
>>
>> Anyway, let's go step by step. Using JDK-11 to compile NetBeans seems to
>> have
>> overall support and seems to be moving in the right direction.
>> -jt
>>
>> PS: Ernie, if you decide to enable Frgaal compilation (see PR-2369 for
>> inspiration), you'll get my support.
>>
>>> On 9/30/2021 11:27 PM, Jaroslav Tulach wrote:
>>>> JDK17 is out and Geertjan told me the old request is going to appear
>>>> again.
>>>> Let me thus review an old thread from November/February...
>>>>
>>>> ---------- Forwarded message ---------
>>>> From: Jaroslav Tulach <ja...@gmail.com>
>>>> Date: Feb 9 2021
>>>>
>>>> Hi.
>>>> I knew the time for a discussion like this is going to come when I
>> wrote
>>>> my
>>>> "Compile with JDK-11 javac --release flag" in November. I have just
>> been
>>>> trying
>>>> to find the email in archives, but no luck! I had to resend it. Here
>> is it
>>>> for
>>>> your reference:
>>>>
>>>> https://lists.apache.org/thread.html/
>>>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
>>>> 3Cdev.netbeans.apache.org%3E
>>>>
>>>> I guess I have to agree with Eric, we cannot stick with JDK8 forever.
>> We
>>>> have
>>>> to move on. On the other hand, as you know, I am not fan of [Big Bang
>>>> changes]
>>>> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to
>> propose to
>>>> move
>>>> forward step by step:
>>>>
>>>> Let's require JDK11 to build NetBeans sources.
>>>>
>>>> The switch to JDK11 compiler doesn't mean I suggest to drop running on
>>>> JDK8.
>>>> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
>>>> However we can have it and still move our source code base forward
>> where
>>>> needed.
>>>>
>>>> Matthias wrote:
>>>>>    I think Jaroslav, said, that in the old time, NetBeans was
>>>>>
>>>>> able to be run on JDK-1. I remember that also, but at some point in
>> the
>>>>> 8? cycle build requirements jumped to 8, while target version was
>> still
>>>>> 1.7.
>>>> Yes, that used to be the policy. Even if we restrict the policy to LTS
>>>> versions of Java, JDK17 is near and we have to move forward. As such I
>>>> wanted
>>>> to discuss this issue in November, 2020. I am still puzzled to
>> understand
>>>> where did my email disappear...
>>>>
>>>> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
>>>>
>> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
>>>> This week we managed to make the (automatic) conversion of JDK16's
>> javac
>>>> to
>>>> run on JDK8 and pass all the available tests.
>>>>
>>>> I really wish NetBeans to continue to run on JDK8, but I am ready to
>> do my
>>>> best to allow you to use the latest Java APIs and features where
>> needed. I
>>>> hope we find a balance between these two desires by going step by step.
>>>>
>>>> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
>>>> https://lists.apache.org/thread.html/
>>>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
>>>> 3Cdev.netbeans.apache.org%3E
>>>>
>>>>
>>>> -jt
>>>>
>>>> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
>>>>> Question on the Netbeans project's plan for moving forward towards
>>>>> introducing and utilizing features with newer Java versions.
>>>>>
>>>>> I understand the basic expectations at present are mainly build on
>> Java
>>>>> 8,
>>>>> while being possible to build (with applicable flags or jdk settings)
>> for
>>>>> newer java versions.
>>>>>
>>>>> At what point do we need to take the plunge and start actually using
>> some
>>>>> of the new features for Java 9 and beyond?
>>>>>
>>>>> When compiling with new java, I see
>>>>>
>>>>>      1. references to deprecated or removed interfaces so assume that
>> is
>>>>>      one
>>>>>      thing that would have to be addressed.
>>>>>      2. I see references to "source versions" (I saw one expecting
>> server
>>>>>      version 1.4) which also show up.  As I understand it, at some
>> point
>>>>>      the
>>>>>      general behavior in some of that will be to only support a few jdk
>>>>>
>>>>> version back so assume this might be a case for other needed changes
>>>>> [what
>>>>> makes it a specific version and is it as simple as changing the source
>>>>> version in the project details or build scripts]?
>>>>>
>>>>> Assume doing so would require changes like
>>>>>
>>>>>      1. Any "JDK" specific build details might have to be addressed
>>>>>      2. Address depreciation and source version differences
>>>>>      3. Find existing code which are candidates for refactoring with
>> newer
>>>>>      java features involved
>>>>>      4. Maybe leverage some JDK tools or utilizing netbeans Java
>>>> "refactoring
>>>>
>>>>>      hints" for suggestions (i.e. changing loops to lambdas, utilized
>>>>>      newer
>>>>>
>>>>> file interfaces, etc.)
>>>>>
>>>>>      5. Any dependency libraries would have to be updated with
>> compatible
>>>>>      versions.  This does have the added benefit of utilizing newer
>>>>>      versions
>>>>>
>>>>> in these as well which may include performance, security, or bug fits
>>>>> benefits as well.
>>>>>
>>>>>      6. Update any documentation (i.e. build/runtime environments)
>>>>>
>>>>> Given the recent javadocs build issues requiring newer jdk, it may
>> mean
>>>> the
>>>>
>>>>> time is coming sooner rather than later.
>>>>>
>>>>> I know this would be a major bit of work but I wanted to raise the
>>>> question.
>>>>
>>>>> Eric Bresie
>>>>> ebresie@gmail.com
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>>
>>> For further information about the NetBeans mailing lists, visit:
>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>> --
> Eric Bresie
> ebresie@gmail.com
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
On 12.10.21 09:15, Jaroslav Tulach wrote:
> Hello Matthias.
>
> so 9. 10. 2021 v 17:56 odesílatel Matthias Bläsing <
> mblaesing@doppel-helix.eu> napsal:
>
>> Am Samstag, dem 09.10.2021 um 10:38 -0500 schrieb Eric Bresie:
>>> Frgaal (1) does seem an interesting beast.
>
>> IMHO2: we only gain syntactic sugar.
> No, not at all. We'd get the ability to code against JDK11, 12, 13, 14, ...
> APIs while running the build on JDK8. To quote the website:
>
frgaal is about language features. You can code against 8 and get some 
language features of 8+. But you can't code against 8+ since 8 does not 
have the APIs of 8+. Anything else would be magic (and technically no 
longer a JDK 8 runtime). The maven dependency is a compiler, not a 
runtime or boot classpah ;).

this isn't a novel idea, i vaguely remember compilers which brought 
generics to java 1.4 or something similar. (can't remember the name 
right now)

adding extra steps to stay on 8 is the wrong direction IMO.

-michael


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Scott Palmer <sw...@gmail.com>.

> On Oct 12, 2021, at 3:15 AM, Jaroslav Tulach <ja...@gmail.com> wrote:
> 
> Hello Matthias.
> 
> so 9. 10. 2021 v 17:56 odesílatel Matthias Bläsing <
> mblaesing@doppel-helix.eu> napsal:
> 
>> Am Samstag, dem 09.10.2021 um 10:38 -0500 schrieb Eric Bresie:
>>> Frgaal (1) does seem an interesting beast.
> 
> 
>> IMHO2: we only gain syntactic sugar.
> 
> No, not at all. We'd get the ability to code against JDK11, 12, 13, 14, ...
> APIs while running the build on JDK8. 

You get to code with language features of JDK 11,12,13,…  You can’t use new APIs without running on the JDK that has them, at least that’s how I understand what the Frgaal web site says.  I would vote against adding it as it just starts to muddy the waters… if the code looks like JDK 11+ code, then people are going to expect to call JDK 11+ APIs.  We don’t need “imposter” JDK 11 code.

I personally would vote to go straight to JDK 17 and enable use of all language features and APIs that are not “preview”. Stepping only to JDK 11 at this point is a missed opportunity. Breaking compatibility in any code with JDK 8 is enough that you might as well go to JDK 17.  Get as far ahead as possible.  What is special about JDK 11?

This drawn out process of pretending to support later versions while requiring compatibility with JDK 8, in other words - NB is still held back by the JDK 8 requirement, so no significant progress is made, but now time is split dealing with multiple implementations.  Seems like a waste of effort.  There are options that you’ve pointed out to have a fall-back to Java 8, but if you must have that fallback, do we really have the development resources to maintaining two separate versions of that code.  Why add that complexity?

What is it about requiring JDK 8 compatibility, that prevents you from just sticking with the NB 12.5 code base?   (Honest question)

To do this cleanly, if the NB platform must have JDK 8 compatibility, the cutoff should be at the NB module level.  Decide which modules must still run on JDK 8 and compile those modules with JDK 8.  New modules and existing modules that don’t have the JDK 8 requirement, should use JDK 17 and compile to JDK 17 byte code.  That way the limited resources aren’t spent maintaining two different implementations.

Other mixed approaches seem like complications that will only hurt in the long run.

Cheers,

Scott

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jaroslav Tulach <ja...@gmail.com>.
Hello Matthias.

so 9. 10. 2021 v 17:56 odesílatel Matthias Bläsing <
mblaesing@doppel-helix.eu> napsal:

> Am Samstag, dem 09.10.2021 um 10:38 -0500 schrieb Eric Bresie:
> > Frgaal (1) does seem an interesting beast.


> IMHO2: we only gain syntactic sugar.

No, not at all. We'd get the ability to code against JDK11, 12, 13, 14, ...
APIs while running the build on JDK8. To quote the website:

> With such a change the compiler of your project no longer depends on the
used JDK.
> All the compiler code is downloaded from Maven central and it can run on
anything from JDK8 up.
> ....
> no matter what breaking changes appear in the JDK,
> your project is still going to compile into exactly the same `.class`
files.

That's far more than just a "syntactic sugar". It simplifies the CI!
-jt

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Matthias Bläsing <mb...@doppel-helix.eu>.
Am Samstag, dem 09.10.2021 um 10:38 -0500 schrieb Eric Bresie:
> Frgaal (1) does seem an interesting beast.  How would that work?  Netbeans
> would be compiled using frgaal to support newer features to be still usable
> on Java 8?  Would that in someway have to be targeted (i.e. compiled to a
> specific release target) which would adapter for use on java 8?  Does that
> mean full later java features would have some kind of bridge layer?  Would
> that impact performance in any way?

Please don't. We already struggle with dependencies and quite frankly:
I'd prefer programming java 6, if I can use standard tools, instead of
relying on some random entity, that could go away anytime.

ecj also has backporting functions, but even then, there is a reason,
that the core JDK javac does not do it.

IMHO we already have enough work with two javac: OpenJDK javac and
nbjavac, we don't need the pain of two more tool chains (ecj + frgaal).

IMHO2: we only gain syntactic sugar.

Greetings

Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Michael Bien <mb...@gmail.com>.
On 09.10.21 17:38, Eric Bresie wrote:
> Frgaal (1) does seem an interesting beast.  How would that work?  Netbeans
> would be compiled using frgaal to support newer features to be still usable
> on Java 8?

its not the java syntax which lets you upgrade to a newer JDKs, its just 
a bonus on top of it.

making the tool chain more complicated (and increasing the risk of bugs) 
just to have nicer syntax while staying on 8 is not worth it.

-mbien



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Eric Bresie <eb...@gmail.com>.
Frgaal (1) does seem an interesting beast.  How would that work?  Netbeans
would be compiled using frgaal to support newer features to be still usable
on Java 8?  Would that in someway have to be targeted (i.e. compiled to a
specific release target) which would adapter for use on java 8?  Does that
mean full later java features would have some kind of bridge layer?  Would
that impact performance in any way?

Is this maybe a matter relating to release/source/target/bootclasspath (2)
aspects of things?

Would multiple release jars (3) be needed as part of this?  Then version
specific items can be added in applicable namespace and compiled for given
releases as needed (i.e. build steps for each supported java release
version)?  In theory it might bloat things a little but it would extend
compatibility with older java for a little longer.

Assume some of this would be considered during CI build pipeline as where
somewhere.

So from a higher level…
* There is netbeans source code
** may/may not use newer java version APIs.
** If there are new java API features used (i.e. modules, block quotes,
records, etc.) this adds a dependency on the given java version introduced
during compile time
** If present but used on an older version would need to bridge between it
(i.e. if supported use it if not then need to either have a wrapper,
“adapter” [frgaal] means of leveraging new in an old environment, or multi
release jar]

* There is the java used to compile netbeans
** Used to compile to byte code of a specific version
** Possible to compile to older release versions
** May be impacting of release/source/target/bootclasspath build/run
settings

* There is the java used to run
** As long as compiled to be compatible with a specific release version it
should run.
** If not compiled to be compatible, it doesn’t run (i.e. bytecode
compatibility issue, unavailable APIs, etc.)
** My require “bridging”/“adapting” [frgaal] to run on

* There is the java used to compile the [external] dependencies
** Each external dependency has its own java compatible version and may
require updated dependencies (i.e. if using dependency not compiled it may
work but if something calls from external back, there is a chance it may
not be compatible due to conflicting java versions)

Eric

References
(1) http://frgaal.org/
(2)
https://stackoverflow.com/questions/43102787/what-is-the-release-flag-in-the-java-9-compiler
(3) https://nipafx.dev/multi-release-jars-multiple-java-versions/

On Thu, Oct 7, 2021 at 12:58 AM Jaroslav Tulach <ja...@gmail.com>
wrote:

> Dne sobota 2. října 2021 1:38:20 CEST, Ernie Rael napsal(a):
> > frgaal?
> >
> > How about allowing any/all jdk-11 language features and if a developer
> > needs to run on jdk8 they must use frgaal to compile NB for jdk8?
>
> Frgaal, that'd be fantastic! As far as I know the latest version supports
> all
> JDK16 features including records. Fellow developers could code with the
> newest
> language features, while still target JDK8 APIs and bytecode version.
>
> Anyway, let's go step by step. Using JDK-11 to compile NetBeans seems to
> have
> overall support and seems to be moving in the right direction.
> -jt
>
> PS: Ernie, if you decide to enable Frgaal compilation (see PR-2369 for
> inspiration), you'll get my support.
>
> > On 9/30/2021 11:27 PM, Jaroslav Tulach wrote:
> > > JDK17 is out and Geertjan told me the old request is going to appear
> > > again.
> > > Let me thus review an old thread from November/February...
> > >
> > > ---------- Forwarded message ---------
> > > From: Jaroslav Tulach <ja...@gmail.com>
> > > Date: Feb 9 2021
> > >
> > > Hi.
> > > I knew the time for a discussion like this is going to come when I
> wrote
> > > my
> > > "Compile with JDK-11 javac --release flag" in November. I have just
> been
> > > trying
> > > to find the email in archives, but no luck! I had to resend it. Here
> is it
> > > for
> > > your reference:
> > >
> > > https://lists.apache.org/thread.html/
> > > r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> > > 3Cdev.netbeans.apache.org%3E
> > >
> > > I guess I have to agree with Eric, we cannot stick with JDK8 forever.
> We
> > > have
> > > to move on. On the other hand, as you know, I am not fan of [Big Bang
> > > changes]
> > > (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to
> propose to
> > > move
> > > forward step by step:
> > >
> > > Let's require JDK11 to build NetBeans sources.
> > >
> > > The switch to JDK11 compiler doesn't mean I suggest to drop running on
> > > JDK8.
> > > Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
> > > However we can have it and still move our source code base forward
> where
> > > needed.
> > >
> > > Matthias wrote:
> > >>   I think Jaroslav, said, that in the old time, NetBeans was
> > >>
> > >> able to be run on JDK-1. I remember that also, but at some point in
> the
> > >> 8? cycle build requirements jumped to 8, while target version was
> still
> > >> 1.7.
> > >
> > > Yes, that used to be the policy. Even if we restrict the policy to LTS
> > > versions of Java, JDK17 is near and we have to move forward. As such I
> > > wanted
> > > to discuss this issue in November, 2020. I am still puzzled to
> understand
> > > where did my email disappear...
> > >
> > > Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> > >
> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> > > This week we managed to make the (automatic) conversion of JDK16's
> javac
> > > to
> > > run on JDK8 and pass all the available tests.
> > >
> > > I really wish NetBeans to continue to run on JDK8, but I am ready to
> do my
> > > best to allow you to use the latest Java APIs and features where
> needed. I
> > > hope we find a balance between these two desires by going step by step.
> > >
> > > As such I repeat my suggestion: let's require JDK11 to build NetBeans:
> > > https://lists.apache.org/thread.html/
> > > r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> > > 3Cdev.netbeans.apache.org%3E
> > >
> > >
> > > -jt
> > >
> > > Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> > >> Question on the Netbeans project's plan for moving forward towards
> > >> introducing and utilizing features with newer Java versions.
> > >>
> > >> I understand the basic expectations at present are mainly build on
> Java
> > >> 8,
> > >> while being possible to build (with applicable flags or jdk settings)
> for
> > >> newer java versions.
> > >>
> > >> At what point do we need to take the plunge and start actually using
> some
> > >> of the new features for Java 9 and beyond?
> > >>
> > >> When compiling with new java, I see
> > >>
> > >>     1. references to deprecated or removed interfaces so assume that
> is
> > >>     one
> > >>     thing that would have to be addressed.
> > >>     2. I see references to "source versions" (I saw one expecting
> server
> > >>     version 1.4) which also show up.  As I understand it, at some
> point
> > >>     the
> > >>     general behavior in some of that will be to only support a few jdk
> > >>
> > >> version back so assume this might be a case for other needed changes
> > >> [what
> > >> makes it a specific version and is it as simple as changing the source
> > >> version in the project details or build scripts]?
> > >>
> > >> Assume doing so would require changes like
> > >>
> > >>     1. Any "JDK" specific build details might have to be addressed
> > >>     2. Address depreciation and source version differences
> > >>     3. Find existing code which are candidates for refactoring with
> newer
> > >>     java features involved
> > >>     4. Maybe leverage some JDK tools or utilizing netbeans Java
> > >
> > > "refactoring
> > >
> > >>     hints" for suggestions (i.e. changing loops to lambdas, utilized
> > >>     newer
> > >>
> > >> file interfaces, etc.)
> > >>
> > >>     5. Any dependency libraries would have to be updated with
> compatible
> > >>     versions.  This does have the added benefit of utilizing newer
> > >>     versions
> > >>
> > >> in these as well which may include performance, security, or bug fits
> > >> benefits as well.
> > >>
> > >>     6. Update any documentation (i.e. build/runtime environments)
> > >>
> > >> Given the recent javadocs build issues requiring newer jdk, it may
> mean
> > >
> > > the
> > >
> > >> time is coming sooner rather than later.
> > >>
> > >> I know this would be a major bit of work but I wanted to raise the
> > >
> > > question.
> > >
> > >> Eric Bresie
> > >> ebresie@gmail.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> > For additional commands, e-mail: dev-help@netbeans.apache.org
> >
> > For further information about the NetBeans mailing lists, visit:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
> --
Eric Bresie
ebresie@gmail.com

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jaroslav Tulach <ja...@gmail.com>.
Dne sobota 2. října 2021 1:38:20 CEST, Ernie Rael napsal(a):
> frgaal?
> 
> How about allowing any/all jdk-11 language features and if a developer
> needs to run on jdk8 they must use frgaal to compile NB for jdk8?

Frgaal, that'd be fantastic! As far as I know the latest version supports all 
JDK16 features including records. Fellow developers could code with the newest 
language features, while still target JDK8 APIs and bytecode version.

Anyway, let's go step by step. Using JDK-11 to compile NetBeans seems to have 
overall support and seems to be moving in the right direction. 
-jt

PS: Ernie, if you decide to enable Frgaal compilation (see PR-2369 for 
inspiration), you'll get my support.

> On 9/30/2021 11:27 PM, Jaroslav Tulach wrote:
> > JDK17 is out and Geertjan told me the old request is going to appear
> > again.
> > Let me thus review an old thread from November/February...
> > 
> > ---------- Forwarded message ---------
> > From: Jaroslav Tulach <ja...@gmail.com>
> > Date: Feb 9 2021
> > 
> > Hi.
> > I knew the time for a discussion like this is going to come when I wrote
> > my
> > "Compile with JDK-11 javac --release flag" in November. I have just been
> > trying
> > to find the email in archives, but no luck! I had to resend it. Here is it
> > for
> > your reference:
> > 
> > https://lists.apache.org/thread.html/
> > r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> > 3Cdev.netbeans.apache.org%3E
> > 
> > I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
> > have
> > to move on. On the other hand, as you know, I am not fan of [Big Bang
> > changes]
> > (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
> > move
> > forward step by step:
> > 
> > Let's require JDK11 to build NetBeans sources.
> > 
> > The switch to JDK11 compiler doesn't mean I suggest to drop running on
> > JDK8.
> > Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
> > However we can have it and still move our source code base forward where
> > needed.
> > 
> > Matthias wrote:
> >>   I think Jaroslav, said, that in the old time, NetBeans was
> >> 
> >> able to be run on JDK-1. I remember that also, but at some point in the
> >> 8? cycle build requirements jumped to 8, while target version was still
> >> 1.7.
> > 
> > Yes, that used to be the policy. Even if we restrict the policy to LTS
> > versions of Java, JDK17 is near and we have to move forward. As such I
> > wanted
> > to discuss this issue in November, 2020. I am still puzzled to understand
> > where did my email disappear...
> > 
> > Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> > https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> > This week we managed to make the (automatic) conversion of JDK16's javac
> > to
> > run on JDK8 and pass all the available tests.
> > 
> > I really wish NetBeans to continue to run on JDK8, but I am ready to do my
> > best to allow you to use the latest Java APIs and features where needed. I
> > hope we find a balance between these two desires by going step by step.
> > 
> > As such I repeat my suggestion: let's require JDK11 to build NetBeans:
> > https://lists.apache.org/thread.html/
> > r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> > 3Cdev.netbeans.apache.org%3E
> > 
> > 
> > -jt
> > 
> > Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> >> Question on the Netbeans project's plan for moving forward towards
> >> introducing and utilizing features with newer Java versions.
> >> 
> >> I understand the basic expectations at present are mainly build on Java
> >> 8,
> >> while being possible to build (with applicable flags or jdk settings) for
> >> newer java versions.
> >> 
> >> At what point do we need to take the plunge and start actually using some
> >> of the new features for Java 9 and beyond?
> >> 
> >> When compiling with new java, I see
> >> 
> >>     1. references to deprecated or removed interfaces so assume that is
> >>     one
> >>     thing that would have to be addressed.
> >>     2. I see references to "source versions" (I saw one expecting server
> >>     version 1.4) which also show up.  As I understand it, at some point
> >>     the
> >>     general behavior in some of that will be to only support a few jdk
> >> 
> >> version back so assume this might be a case for other needed changes
> >> [what
> >> makes it a specific version and is it as simple as changing the source
> >> version in the project details or build scripts]?
> >> 
> >> Assume doing so would require changes like
> >> 
> >>     1. Any "JDK" specific build details might have to be addressed
> >>     2. Address depreciation and source version differences
> >>     3. Find existing code which are candidates for refactoring with newer
> >>     java features involved
> >>     4. Maybe leverage some JDK tools or utilizing netbeans Java
> > 
> > "refactoring
> > 
> >>     hints" for suggestions (i.e. changing loops to lambdas, utilized
> >>     newer
> >> 
> >> file interfaces, etc.)
> >> 
> >>     5. Any dependency libraries would have to be updated with compatible
> >>     versions.  This does have the added benefit of utilizing newer
> >>     versions
> >> 
> >> in these as well which may include performance, security, or bug fits
> >> benefits as well.
> >> 
> >>     6. Update any documentation (i.e. build/runtime environments)
> >> 
> >> Given the recent javadocs build issues requiring newer jdk, it may mean
> > 
> > the
> > 
> >> time is coming sooner rather than later.
> >> 
> >> I know this would be a major bit of work but I wanted to raise the
> > 
> > question.
> > 
> >> Eric Bresie
> >> ebresie@gmail.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
> 
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Neil C Smith <ne...@apache.org>.
On Sat, 2 Oct 2021, 21:02 Will Hartung, <wi...@gmail.com> wrote:

> This will probably be heresy, but any reason to not bump up to v13 so that
> it's blatantly obvious something dramatic has changed? (Base JDK is kind of
> dramatic)
>

We're planning a lazy consensus thread (or two) on a bunch of 12.6+ release
matters once this discussion seems somewhat settled. Following release was
planned to probably be 13 anyway.

Best wishes,

Neil

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Will Hartung <wi...@gmail.com>.
This will probably be heresy, but any reason to not bump up to v13 so that
it's blatantly obvious something dramatic has changed? (Base JDK is kind of
dramatic)

Re: [DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Ernie Rael <er...@raelity.com>.
frgaal?

How about allowing any/all jdk-11 language features and if a developer 
needs to run on jdk8 they must use frgaal to compile NB for jdk8?

-ernie

On 9/30/2021 11:27 PM, Jaroslav Tulach wrote:
> JDK17 is out and Geertjan told me the old request is going to appear again.
> Let me thus review an old thread from November/February...
>
> ---------- Forwarded message ---------
> From: Jaroslav Tulach <ja...@gmail.com>
> Date: Feb 9 2021
>
> Hi.
> I knew the time for a discussion like this is going to come when I wrote my
> "Compile with JDK-11 javac --release flag" in November. I have just been
> trying
> to find the email in archives, but no luck! I had to resend it. Here is it
> for
> your reference:
>
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
> I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
> have
> to move on. On the other hand, as you know, I am not fan of [Big Bang
> changes]
> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
> move
> forward step by step:
>
> Let's require JDK11 to build NetBeans sources.
>
> The switch to JDK11 compiler doesn't mean I suggest to drop running on
> JDK8.
> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
> However we can have it and still move our source code base forward where
> needed.
>
> Matthias wrote:
>>   I think Jaroslav, said, that in the old time, NetBeans was
>> able to be run on JDK-1. I remember that also, but at some point in the
>> 8? cycle build requirements jumped to 8, while target version was still
>> 1.7.
> Yes, that used to be the policy. Even if we restrict the policy to LTS
> versions of Java, JDK17 is near and we have to move forward. As such I
> wanted
> to discuss this issue in November, 2020. I am still puzzled to understand
> where did my email disappear...
>
> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> This week we managed to make the (automatic) conversion of JDK16's javac to
> run on JDK8 and pass all the available tests.
>
> I really wish NetBeans to continue to run on JDK8, but I am ready to do my
> best to allow you to use the latest Java APIs and features where needed. I
> hope we find a balance between these two desires by going step by step.
>
> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
>
> -jt
>
>
>
>
>
>
>
> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
>> Question on the Netbeans project's plan for moving forward towards
>> introducing and utilizing features with newer Java versions.
>>
>> I understand the basic expectations at present are mainly build on Java 8,
>> while being possible to build (with applicable flags or jdk settings) for
>> newer java versions.
>>
>> At what point do we need to take the plunge and start actually using some
>> of the new features for Java 9 and beyond?
>>
>> When compiling with new java, I see
>>
>>     1. references to deprecated or removed interfaces so assume that is one
>>     thing that would have to be addressed.
>>     2. I see references to "source versions" (I saw one expecting server
>>     version 1.4) which also show up.  As I understand it, at some point the
>>     general behavior in some of that will be to only support a few jdk
>> version back so assume this might be a case for other needed changes [what
>> makes it a specific version and is it as simple as changing the source
>> version in the project details or build scripts]?
>>
>> Assume doing so would require changes like
>>
>>     1. Any "JDK" specific build details might have to be addressed
>>     2. Address depreciation and source version differences
>>     3. Find existing code which are candidates for refactoring with newer
>>     java features involved
>>     4. Maybe leverage some JDK tools or utilizing netbeans Java
> "refactoring
>>     hints" for suggestions (i.e. changing loops to lambdas, utilized newer
>> file interfaces, etc.)
>>     5. Any dependency libraries would have to be updated with compatible
>>     versions.  This does have the added benefit of utilizing newer versions
>> in these as well which may include performance, security, or bug fits
>> benefits as well.
>>     6. Update any documentation (i.e. build/runtime environments)
>>
>> Given the recent javadocs build issues requiring newer jdk, it may mean
> the
>> time is coming sooner rather than later.
>>
>> I know this would be a major bit of work but I wanted to raise the
> question.
>> Eric Bresie
>> ebresie@gmail.com



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




[DISCUSS] Let's require NetBeans to be built with JDK11 was: reviving old thread

Posted by Jaroslav Tulach <ja...@gmail.com>.
JDK17 is out and Geertjan told me the old request is going to appear again.
Let me thus review an old thread from November/February...

---------- Forwarded message ---------
From: Jaroslav Tulach <ja...@gmail.com>
Date: Feb 9 2021

Hi.
I knew the time for a discussion like this is going to come when I wrote my
"Compile with JDK-11 javac --release flag" in November. I have just been
trying
to find the email in archives, but no luck! I had to resend it. Here is it
for
your reference:

https://lists.apache.org/thread.html/
r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
3Cdev.netbeans.apache.org%3E

I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
have
to move on. On the other hand, as you know, I am not fan of [Big Bang
changes]
(http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
move
forward step by step:

Let's require JDK11 to build NetBeans sources.

The switch to JDK11 compiler doesn't mean I suggest to drop running on
JDK8.
Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
However we can have it and still move our source code base forward where
needed.

Matthias wrote:
>  I think Jaroslav, said, that in the old time, NetBeans was
> able to be run on JDK-1. I remember that also, but at some point in the
> 8? cycle build requirements jumped to 8, while target version was still
> 1.7.

Yes, that used to be the policy. Even if we restrict the policy to LTS
versions of Java, JDK17 is near and we have to move forward. As such I
wanted
to discuss this issue in November, 2020. I am still puzzled to understand
where did my email disappear...

Btw. there is `nb-javac` for JDK8 - related work I am involved in:
https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
This week we managed to make the (automatic) conversion of JDK16's javac to
run on JDK8 and pass all the available tests.

I really wish NetBeans to continue to run on JDK8, but I am ready to do my
best to allow you to use the latest Java APIs and features where needed. I
hope we find a balance between these two desires by going step by step.

As such I repeat my suggestion: let's require JDK11 to build NetBeans:
https://lists.apache.org/thread.html/
r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
3Cdev.netbeans.apache.org%3E


-jt







Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> Question on the Netbeans project's plan for moving forward towards
> introducing and utilizing features with newer Java versions.
>
> I understand the basic expectations at present are mainly build on Java 8,
> while being possible to build (with applicable flags or jdk settings) for
> newer java versions.
>
> At what point do we need to take the plunge and start actually using some
> of the new features for Java 9 and beyond?
>
> When compiling with new java, I see
>
>    1. references to deprecated or removed interfaces so assume that is one
>    thing that would have to be addressed.
>    2. I see references to "source versions" (I saw one expecting server
>    version 1.4) which also show up.  As I understand it, at some point the
>    general behavior in some of that will be to only support a few jdk
> version back so assume this might be a case for other needed changes [what
> makes it a specific version and is it as simple as changing the source
> version in the project details or build scripts]?
>
> Assume doing so would require changes like
>
>    1. Any "JDK" specific build details might have to be addressed
>    2. Address depreciation and source version differences
>    3. Find existing code which are candidates for refactoring with newer
>    java features involved
>    4. Maybe leverage some JDK tools or utilizing netbeans Java
"refactoring
>    hints" for suggestions (i.e. changing loops to lambdas, utilized newer
> file interfaces, etc.)
>    5. Any dependency libraries would have to be updated with compatible
>    versions.  This does have the added benefit of utilizing newer versions
> in these as well which may include performance, security, or bug fits
> benefits as well.
>    6. Update any documentation (i.e. build/runtime environments)
>
> Given the recent javadocs build issues requiring newer jdk, it may mean
the
> time is coming sooner rather than later.
>
> I know this would be a major bit of work but I wanted to raise the
question.
>
> Eric Bresie
> ebresie@gmail.com

Re: compile NetBeans with JDK11

Posted by Emilio Gallardo Cantella <ra...@outlook.com>.
Just my 2 cents: consider how currently the build instructions for each 
release on the website 
(https://netbeans.apache.org/download/nb122/nb122.html), and the build 
from source instructions on the daily builds page 
(https://netbeans.apache.org/download/dev/index.html), are fairly 
different. Not only is it necessary to use an additional flag when 
building with anything after jdk8, the "|-Dpermit.jdk9.builds=true|", 
but trying to introduce or modify more flags without standardizing the 
more simple ant (build) commands could be a problem.

EGC

On 2/9/2021 16:02, Brad Walker wrote:
> Hey Jaroslav,
>
> I have a question related to this.
>
> What would be the proper, accepted way to build Netbeans using JDK11?
>
> -brad w.
>
> ps: I changed the subject line since the question is not directly related..
>
> On Tue, Feb 9, 2021 at 12:19 PM Jaroslav Tulach <ja...@gmail.com>
> wrote:
>
>> Hi.
>> I knew the time for a discussion like this is going to come when I wrote
>> my
>> "Compile with JDK-11 javac --release flag" in November. I have just been
>> trying
>> to find the email in archives, but no luck! I had to resend it. Here is it
>> for
>> your reference:
>>
>> https://lists.apache.org/thread.html/
>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
>> 3Cdev.netbeans.apache.org%3E
>>
>> I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
>> have
>> to move on. On the other hand, as you know, I am not fan of [Big Bang
>> changes]
>> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
>> move
>> forward step by step:
>>
>> Let's require JDK11 to build NetBeans sources.
>>
>> The switch to JDK11 compiler doesn't mean I suggest to drop running on
>> JDK8.
>> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
>> However we can have it and still move our source code base forward where
>> needed.
>>
>> Matthias wrote:
>>>   I think Jaroslav, said, that in the old time, NetBeans was
>>> able to be run on JDK-1. I remember that also, but at some point in the
>>> 8? cycle build requirements jumped to 8, while target version was still
>>> 1.7.
>> Yes, that used to be the policy. Even if we restrict the policy to LTS
>> versions of Java, JDK17 is near and we have to move forward. As such I
>> wanted
>> to discuss this issue in November, 2020. I am still puzzled to understand
>> where did my email disappear...
>>
>> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
>> This week we managed to make the (automatic) conversion of JDK16's javac
>> to
>> run on JDK8 and pass all the available tests.
>>
>> I really wish NetBeans to continue to run on JDK8, but I am ready to do my
>> best to allow you to use the latest Java APIs and features where needed. I
>> hope we find a balance between these two desires by going step by step.
>>
>> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
>> https://lists.apache.org/thread.html/
>> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
>> 3Cdev.netbeans.apache.org%3E
>>
>>
>> -jt
>>
>>
>>
>>
>> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
>>> Question on the Netbeans project's plan for moving forward towards
>>> introducing and utilizing features with newer Java versions.
>>>
>>> I understand the basic expectations at present are mainly build on Java
>> 8,
>>> while being possible to build (with applicable flags or jdk settings) for
>>> newer java versions.
>>>
>>> At what point do we need to take the plunge and start actually using some
>>> of the new features for Java 9 and beyond?
>>>
>>> When compiling with new java, I see
>>>
>>>     1. references to deprecated or removed interfaces so assume that is
>> one
>>>     thing that would have to be addressed.
>>>     2. I see references to "source versions" (I saw one expecting server
>>>     version 1.4) which also show up.  As I understand it, at some point
>> the
>>>     general behavior in some of that will be to only support a few jdk
>>> version back so assume this might be a case for other needed changes
>> [what
>>> makes it a specific version and is it as simple as changing the source
>>> version in the project details or build scripts]?
>>>
>>> Assume doing so would require changes like
>>>
>>>     1. Any "JDK" specific build details might have to be addressed
>>>     2. Address depreciation and source version differences
>>>     3. Find existing code which are candidates for refactoring with newer
>>>     java features involved
>>>     4. Maybe leverage some JDK tools or utilizing netbeans Java
>> "refactoring
>>>     hints" for suggestions (i.e. changing loops to lambdas, utilized newer
>>> file interfaces, etc.)
>>>     5. Any dependency libraries would have to be updated with compatible
>>>     versions.  This does have the added benefit of utilizing newer
>> versions
>>> in these as well which may include performance, security, or bug fits
>>> benefits as well.
>>>     6. Update any documentation (i.e. build/runtime environments)
>>>
>>> Given the recent javadocs build issues requiring newer jdk, it may mean
>> the
>>> time is coming sooner rather than later.
>>>
>>> I know this would be a major bit of work but I wanted to raise the
>> question.
>>> Eric Bresie
>>> ebresie@gmail.com
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
>> For additional commands, e-mail: dev-help@netbeans.apache.org
>>
>> For further information about the NetBeans mailing lists, visit:
>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>>
>>
>>
>>

Re: compile NetBeans with JDK11

Posted by Jaroslav Tulach <ja...@gmail.com>.
Dne úterý 9. února 2021 22:02:14 CET, Brad Walker napsal(a):
> Hey Jaroslav,
> 
> I have a question related to this.
> 
> What would be the proper, accepted way to build Netbeans using JDK11?

Hello Brad,
[in November](https://lists.apache.org/thread.html/
r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%3Cdev.netbeans.apache.org%3E) 
I was experimenting with:

> Let's enable usage of `--release` in our Ant Javac task and let's make it
> the same as the `javac.target` value:

```diff
--- a/nbbuild/antsrc/org/netbeans/nbbuild/CustomJavac.java
+++ b/nbbuild/antsrc/org/netbeans/nbbuild/CustomJavac.java
@@ -66,6 +66,11 @@

     @Override
     public void execute() throws BuildException {
+        String tgr = getTarget();
+        if (tgr.matches("\\d+")) {
+            tgr = "1." + tgr;
+        }
+        setRelease(tgr.substring(2));
         String src = getSource();
         if (src.matches("\\d+")) {
             src = "1." + src;
```

That immediately shows errors in our code base. Just compile with JDK-11 and
you'll see errors like:

```bash
 [nb-javac] Compiling 8 source files to /netbeans/platform/queries/build/
classes
 [nb-javac] Ignoring source, target and bootclasspath as release has been
set [repeat] warning: [options] source value 6 is obsolete and will be
removed in a future release
   [repeat] warning: [options] target value 1.6 is obsolete and will be
removed in a future release
   [repeat] warning: [options] To suppress warnings about obsolete options,
use -Xlint:-options.
   [repeat] /netbeans/platform/queries/src/org/netbeans/api/queries/
VersioningQuery.java:52: error: cannot find symbol
   [repeat]         java.util.Objects.requireNonNull(uri);
   [repeat]                  ^
   [repeat]   symbol:   class Objects
   [repeat]   location: package java.util
   [repeat] 1 error
   [repeat] 3 warnings
  [nbmerge] Failed to build target: all-queries
```

What's the problem? In spite our code sets the `javac.target=1.6`, it is
using API which isn't present in JDK6. That's wrong. Let's fix that!

We need a Travis job using JDK-11 to compile (JDK8 doesn't support the `--
release` flag and Ant javac task just ignores it) and then we need us to fix
all the compilation issues found.

If the change is done properly (and the `--release` flag is used at all
compilations), we can drop the requirement to use JDK8 to compile Apache
NetBeans. Yet the code will still run on JDK8 thanks to using `--release 8`
or older. How does that sound?

Jaroslav Tulach
NetBeans Platform Architect




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
For additional commands, e-mail: dev-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists




compile NetBeans with JDK11

Posted by Brad Walker <bw...@musings.com>.
Hey Jaroslav,

I have a question related to this.

What would be the proper, accepted way to build Netbeans using JDK11?

-brad w.

ps: I changed the subject line since the question is not directly related..

On Tue, Feb 9, 2021 at 12:19 PM Jaroslav Tulach <ja...@gmail.com>
wrote:

> Hi.
> I knew the time for a discussion like this is going to come when I wrote
> my
> "Compile with JDK-11 javac --release flag" in November. I have just been
> trying
> to find the email in archives, but no luck! I had to resend it. Here is it
> for
> your reference:
>
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
> I guess I have to agree with Eric, we cannot stick with JDK8 forever. We
> have
> to move on. On the other hand, as you know, I am not fan of [Big Bang
> changes]
> (http://wiki.apidesign.org/wiki/Big_Bang), as such I'd like to propose to
> move
> forward step by step:
>
> Let's require JDK11 to build NetBeans sources.
>
> The switch to JDK11 compiler doesn't mean I suggest to drop running on
> JDK8.
> Me, my employer/gang, OracleLabs, still need to run VSNetBeans on JDK8.
> However we can have it and still move our source code base forward where
> needed.
>
> Matthias wrote:
> >  I think Jaroslav, said, that in the old time, NetBeans was
> > able to be run on JDK-1. I remember that also, but at some point in the
> > 8? cycle build requirements jumped to 8, while target version was still
> > 1.7.
>
> Yes, that used to be the policy. Even if we restrict the policy to LTS
> versions of Java, JDK17 is near and we have to move forward. As such I
> wanted
> to discuss this issue in November, 2020. I am still puzzled to understand
> where did my email disappear...
>
> Btw. there is `nb-javac` for JDK8 - related work I am involved in:
> https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
> This week we managed to make the (automatic) conversion of JDK16's javac
> to
> run on JDK8 and pass all the available tests.
>
> I really wish NetBeans to continue to run on JDK8, but I am ready to do my
> best to allow you to use the latest Java APIs and features where needed. I
> hope we find a balance between these two desires by going step by step.
>
> As such I repeat my suggestion: let's require JDK11 to build NetBeans:
> https://lists.apache.org/thread.html/
> r94d421ce16f609687c769125425b46f2322033879120b00afddbe17b%40%
> 3Cdev.netbeans.apache.org%3E
>
>
> -jt
>
>
>
>
> Dne pátek 5. února 2021 16:12:10 CET, Eric Bresie napsal(a):
> > Question on the Netbeans project's plan for moving forward towards
> > introducing and utilizing features with newer Java versions.
> >
> > I understand the basic expectations at present are mainly build on Java
> 8,
> > while being possible to build (with applicable flags or jdk settings) for
> > newer java versions.
> >
> > At what point do we need to take the plunge and start actually using some
> > of the new features for Java 9 and beyond?
> >
> > When compiling with new java, I see
> >
> >    1. references to deprecated or removed interfaces so assume that is
> one
> >    thing that would have to be addressed.
> >    2. I see references to "source versions" (I saw one expecting server
> >    version 1.4) which also show up.  As I understand it, at some point
> the
> >    general behavior in some of that will be to only support a few jdk
> > version back so assume this might be a case for other needed changes
> [what
> > makes it a specific version and is it as simple as changing the source
> > version in the project details or build scripts]?
> >
> > Assume doing so would require changes like
> >
> >    1. Any "JDK" specific build details might have to be addressed
> >    2. Address depreciation and source version differences
> >    3. Find existing code which are candidates for refactoring with newer
> >    java features involved
> >    4. Maybe leverage some JDK tools or utilizing netbeans Java
> "refactoring
> >    hints" for suggestions (i.e. changing loops to lambdas, utilized newer
> > file interfaces, etc.)
> >    5. Any dependency libraries would have to be updated with compatible
> >    versions.  This does have the added benefit of utilizing newer
> versions
> > in these as well which may include performance, security, or bug fits
> > benefits as well.
> >    6. Update any documentation (i.e. build/runtime environments)
> >
> > Given the recent javadocs build issues requiring newer jdk, it may mean
> the
> > time is coming sooner rather than later.
> >
> > I know this would be a major bit of work but I wanted to raise the
> question.
> >
> > Eric Bresie
> > ebresie@gmail.com
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: dev-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
>
>
>
>