On Tue, Apr 28, 2020 at 7:50 PM Eirik Bakke <eba...@ultorg.com> wrote:

> Sure. Though I think the user would be surprised if
> editing/code-completion just silently doesn't work, when building/running
> does. There needs to be a message of some sort, recommending running the
> IDE on a later JDK.
>
> Otherwise we risk having users go "Well, I tried NetBeans once, and it
> didn't work very well", or "but it doesn't do code completion like Eclipse
> does", without knowing that there was a specific fixable problem.
>

But there is the UI for this, correct? I mean, when one activates the Java
support (in the default build), the UI will even refuse to activate it on
JDK 8 without installing nb-javac. And even if it gets enabled (e.g. by
using a non-default build), the user will get a dialog on the first start,
and then a nag in the notification area on every subsequent start. We could
add e.g. a warning to all Java editors, but does not feel necessary to me -
I think the UI is pushing the user in the right direction fairly strongly.

On JDK 9+ (JDK 11+), the Java support can be enabled without nb-javac, and
there is no dialog, but the nagging in the notification area is still
there. (But the Java editor works, although not perfectly, even without
nb-javac on JDK 11+.)

I believe the changes done and/or proposed for 12.0 are:
-in the activation dialog, if nb-javac is unchecked, and "Download and
Activate" is selected (to download JavaFX), it used to download nb-javac
unconditionally. I believe this is fixed by Jaroslav - if the checkbox is
unchecked, nb-javac is not downloaded. Which is correct.
-when the runtime JDK is JDK 14+, do not nag the user to install nb-javac.
The reason is that nb-javac is still based on javac from JDK 13, and people
are confused JDK 14 features are not working properly for them when running
with nb-javac. This is https://github.com/apache/netbeans/pull/2108 Note
that the user still can install nb-javac, just the IDE will not nag him on
every start to do so.

(I think it is a little too late to do something more challenging for 12.0.)

The behavior of the NetBeans' Java editor without nb-javac is (I hope!)
improving with every NetBeans and JDK release, it is somewhat difficult to
keep track of individual changes (and some of the changes are just
technical details which may e.g. sometimes lead to an exception being
thrown from code completion, or something like that). AFAIK, there are
currently four bigish differences in behavior of the Java editor with and
without nb-javac (running on JDK 13/14):
-Compile on Save does not work without nb-javac. Solvable, but requires
quite some work and testing.
-refactoring/find usages are much slower without nb-javac. Work on this is
being done in https://github.com/apache/netbeans/pull/1890. (It includes
some compromises, but hopefully acceptable. It will likely to be fast in
most cases, but sometimes it may revert to being slow.)
-code completion is slower (this is presumably mainly noticeable on big
source files). This is because the code completion was sped up using
"partial reparse" (if a file is parsed, then modified inside one method and
then code completion is invoked, only the single method was reparsed, not
the whole source). There is an implementation of that which does not need
nb-javac, but is disabled by default, as I think it needs more testing.
Should be possible to enable using command line flag
-J-Djava.enable.partial.reparse=true
-as the initial scan processes projects, processing of every project (more
precisely source root) must fit into the memory at once when running
without nb-javac. With nb-javac, the code may be processed in parts. So
far, I think this is the only part that is not reasonably solvable. But I
think the impact on users is likely to be low.

Then there is a set of issues related to error recovery and bugs, but I
don't think I have a full list of those. This is e.g. Eirik's NETBEANS-4179
- an exception for erroneous code (this specific issue should be alleviated
for JDK 15, see https://bugs.openjdk.java.net/browse/JDK-8243047). Again, I
hope the situation is improving there, release after release, but I don't
expect that we will deal with all such issues soon - some such issues exist
even with nb-javac.

Overall, if there is a particular case that bothers you, best would be to
report it (with as good reproducible case as possible), and nag me about it
(unless you want to try to solve it yourself - which would be awesome,
BTW). I am surely willing to look at stuff that bothers people most,
if/when I can. I note that Eirik reported several bugs, which I
wholeheartedly appreciate - even though I still need to look at some of
them.

Jan


>
> -- Eirik
>
> -----Original Message-----
> From: Geertjan Wielenga <geert...@apache.org>
> Sent: Tuesday, April 28, 2020 1:08 PM
> To: dev@netbeans.apache.org
> Subject: Re: nb-javac and the upcoming 12.0
>
> Well, it’s specifically about editing Java source files, in a project that
> uses any JDK, when NetBeans itself is running on JDK 8. Under these
> conditions, nb-javac is a requirement — specifically when editing Java
> source files, i.e., when using the Java editor. You can still build, test,
> run, etc.
>
> Gj
>
> On Tue, 28 Apr 2020 at 18:58, Eirik Bakke <eba...@ultorg.com> wrote:
>
> > No, not at all!
> >
> > I just confused the "what JDK the IDE is running on" vs. "what JDK the
> > project is compiled with" when interpreting your proposed restriction.
> >
> > Ideally, a warning should be shown to a user if they try to use a JDK
> > 8 project while running the IDE on a JDK that does not support this.
> > It's a little unintuitive to have to juggle two JDKs here, but that
> > seems a reasonable price to pay if the user really wants to work with
> > a project that must compile with an old JDK.
> >
> > -- Eirik
> >
> > -----Original Message-----
> > From: Geertjan Wielenga <geert...@apache.org>
> > Sent: Tuesday, April 28, 2020 12:53 PM
> > To: dev@netbeans.apache.org
> > Subject: Re: nb-javac and the upcoming 12.0
> >
> > Hopefully that’s not sarcasm. :-)
> >
> > Gj
> >
> > On Tue, 28 Apr 2020 at 18:43, Eirik Bakke <eba...@ultorg.com> wrote:
> >
> > > Oh, now I get it. So you can still compile projects with JDK 8 and
> > > use the editor, but you must run the IDE itself on JDK 14, and with
> > > no nb-javac (to make JDK 8 projects work).
> > >
> > > That actually seems very reasonable!
> > >
> > > -- Eirik
> > >
> > > -----Original Message-----
> > > From: Geertjan Wielenga <geert...@apache.org>
> > > Sent: Tuesday, April 28, 2020 12:29 PM
> > > To: dev@netbeans.apache.org
> > > Subject: Re: nb-javac and the upcoming 12.0
> > >
> > > Yes, the Java editor uses the JDK 14 javac if it runs on that JDK —
> > > even if the build of a particular project uses JDK 8 or anything else.
> > >
> > > Gj
> > >
> > > On Tue, 28 Apr 2020 at 18:25, Scott Palmer <swpal...@gmail.com> wrote:
> > >
> > > > Just my 2 cents... I am all for NB having great first-class
> > > > support for development of projects that use Java 8, but I don’t
> > > > care if I’m forced to run NB itself with JDK-14.
> > > > I realize that some have projects  based on the NB platform that
> > > > they want to run on Java 8. I think if you are in that situation,
> > > > you have to decide to keep with an older version of the NB
> > > > platform because we can’t hold the platform back to Java 8
> > > > compatibility
> > forever.
> > > >
> > > > That being said, I would like to be able to change the default JDK
> > > > for projects so it is a different JDK than what NB is running on.
> > > > Having to go through most of my projects and explicitly flip them
> > > > to use JDK
> > > > 8 is a minor pain, and it also makes sharing the project with a
> > > > team a little more awkward as well. They need additional
> > > > configuration in NB so the right JDK can be found and we have to
> > > > share NB project files that otherwise don’t need to go into the
> project’s source repo.
> > > >
> > > > What is unclear to me, and it seems I’m not alone, is if NB is
> > > > running on
> > > > JDK-14 without nb-javac, what do we miss when working on a project
> > > > that builds with JDK-8? Can the NB editor not use JDK-14’s javac
> > > > even tough the build runs with JDK-8?
> > > >
> > > > Scott
> > > >
> > > > > On Apr 28, 2020, at 10:50 AM, Geertjan Wielenga
> > > > > <geert...@apache.org>
> > > > wrote:
> > > > >
> > > > > You're not going to find me arguing against good support for Java
> 8.
> > > > > However, as stated above, we anticipate that nb-javac will not
> > > > > be ready
> > > > in
> > > > > time for the 12.0 release.
> > > > >
> > > > > Gj
> > > > >
> > > > > On Tue, Apr 28, 2020 at 4:46 PM Eirik Bakke <eba...@ultorg.com>
> > wrote:
> > > > >
> > > > >>> A question is what about JDK 8. My bold suggestion would be
> > > > >>> that we
> > > > >> explicitly tell our users that they can’t use our Java Editor
> > > > >> if they’re running NetBeans on JDK 8.
> > > > >>
> > > > >> I think it's too early to drop first-class support for Java 8,
> > > > >> for the same reasons people listed in the earlier "Pull the
> > > > >> plug from Java 8 in 12.1?" thread.
> > > > >>
> > > > >> Good support for Java 8 is a feature, and an important one for
> > > > >> an IDE
> > > > that
> > > > >> is primarily associated with the Java ecosystem.
> > > > >>
> > > > >> Eirik
> > > > >>
> > > > >> -----Original Message-----
> > > > >> From: Geertjan Wielenga <geert...@apache.org>
> > > > >> Sent: Tuesday, April 28, 2020 2:47 AM
> > > > >> To: dev <dev@netbeans.apache.org>
> > > > >> Subject: nb-javac and the upcoming 12.0
> > > > >>
> > > > >> Hi all,
> > > > >>
> > > > >> We’re getting close to the 12.0 release and nb-javac won’t be
> > > > >> available
> > > > at
> > > > >> the time of release. What nb-javac provides is detailed
> > > > >> elsewhere but in summary it is a fork of the  javac finetuned
> > > > >> to the Java Editor in NetBeans. It can’t be donated to Apache
> > > > >> NetBeans because it is a javac
> > > > fork
> > > > >> and hence GPL licensed, so Oracle does not want to donate it
> > > > >> and Apache projects can’t be released with it.
> > > > >>
> > > > >> Ultimately, we’d like to drop the need for nb-javac completely.
> > > > >> That
> > > > will
> > > > >> simplify things a lot. Plus, that is increasingly possible
> > > > >> because from
> > > > JDK
> > > > >> 9 onwards we’re able to use the javac from the JDK that
> > > > >> NetBeans runs on for the same purposes as nb-javac.
> > > > >>
> > > > >> And we’ve (especially Jan Lahoda) been enhancing Apache
> > > > >> NetBeans over
> > > > the
> > > > >> past releases to enable the vanilla javac from the JDK on which
> > > > >> NetBeans runs to be used increasingly better. And ultimately,
> > > > >> of course, this
> > > > should
> > > > >> not be based on the JDK on which NetBeans runs, but on the JDK
> > > > >> used by a particular project.
> > > > >>
> > > > >> Anyway, there have been one or two pull requests around the
> > > > >> above, such
> > > > as
> > > > >> this one:
> > > > >>
> > > > >> https://github.com/apache/netbeans/pull/2108
> > > > >>
> > > > >> A question is what about JDK 8. My bold suggestion would be
> > > > >> that we explicitly tell our users that they can’t use our Java
> > > > >> Editor if they’re running NetBeans on JDK 8. I’m not saying
> > > > >> that we should drop support
> > > > for
> > > > >> JDK 8. I’m saying we should show a message that the user should
> > > > >> switch
> > > > to
> > > > >> the latest supported JDK for running NetBeans itself on (which
> > > > >> of course does not mean that a project can’t use any earlier JDK).
> > > > >>
> > > > >> Anyway, comments and thoughts welcome.
> > > > >>
> > > > >> Gj
> > > > >>
> > > > >> ---------------------------------------------------------------
> > > > >> --
> > > > >> --
> > > > >> -- To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> > > > >> For additional commands, e-mail: dev-h...@netbeans.apache.org
> > > > >>
> > > > >> For further information about the NetBeans mailing lists, visit:
> > > > >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+li
> > > > >> st
> > > > >> s
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > > ------------------------------------------------------------------
> > > > --
> > > > - To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
> > > > For additional commands, e-mail: dev-h...@netbeans.apache.org
> > > >
> > > > For further information about the NetBeans mailing lists, visit:
> > > > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
> > > >
> > > >
> > > >
> > > >
> > >
> >
>

Reply via email to