You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by Jakub Herkel <jh...@gmail.com> on 2020/11/09 08:34:21 UTC

How to use different versions of javac api in netbeans sources

Hi,

I checked this issue https://issues.apache.org/jira/browse/NETBEANS-1309.
This issue is about a new javadoc @summary tag and that Netbeans doesn't
display any summary when this tag is used in javadoc popup.
I debugged source code and, if I am correct, data for this javadoc popup
are generated in ElementJavadoc class (Java Source UI module). There is a
code :
 for (DocTree tag : tags) {
            switch (tag.getKind()) {
                case REFERENCE:
                    ReferenceTree refTag = (ReferenceTree)tag;
                    appendReference(sb, refTag, null, docPath, doc, trees);
                    break;
...
 case TEXT:
                    TextTree ttag = (TextTree)tag;
                    sb.append(ttag.getBody());
            }

These tags are parts of Java Compiler API. So for Java 10+ there is a new
SUMMARY tag.
But as far as I know Netbeans is compiled with Java 8, so I don't have
access to it. Is there a way how I can use a newer version of Java Compiler
API with Netbeans? Or any hint of what I can do in this issue?

Jakub

Re: How to use different versions of javac api in netbeans sources

Posted by Jan Lahoda <la...@gmail.com>.
Hi John,

Sorry for the delayed answer.

This is unfortunately a bit tricky. NetBeans currently can run on JDK 9+
using, for parsing, the javac that is in the JDK. So we cannot directly use
javac APIs that are newer than JDK 9, we usually use reflection to call
such APIs. This is not pretty but usually works.

Now, for the particular two cases:
-for @summary, maybe it is time to drop the ability to use JDK's javac for
parsing while running on JDK 9 and 10, and require JDK 11+ in this mode
(the nb-javac mode would still be unchanged, JDK 8+). Should be doable, and
does not seem too problematic, as probably only few people are using 9 or
10.
-for @systemProperty, that may be a bit more difficult, I am not convinced
we can drop the ability to use JDK's javac for parsing on JDK 11. I suspect
reflection is probably the only solution there right now. Is that feasible?

Jan



On Mon, Nov 9, 2020 at 6:06 PM John Neffenger <jo...@status6.com> wrote:

> On 11/9/20 12:34 AM, Jakub Herkel wrote:
> > These tags are parts of Java Compiler API. So for Java 10+ there is a new
> > SUMMARY tag.
>
> While we're at it, there's also a handy new Javadoc tag for system
> properties, available in Java 12, that I've noticed is missing in NetBeans:
>
> JEP draft: Guidelines for documenting system properties
> https://openjdk.java.net/jeps/8214497
>
> More details are in the Compatibility & Specification Review below:
>
> Support {@systemProperty <name>} tag
> https://bugs.openjdk.java.net/browse/JDK-8211132
>
> John
>
> ---------------------------------------------------------------------
> 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: How to use different versions of javac api in netbeans sources

Posted by Geertjan Wielenga <ge...@googlemail.com.INVALID>.
The Java editor in NetBeans should use whatever Java compiler that you use
to run NetBeans, if you don't install nb-javac.

Gj

On Wed, Nov 11, 2020 at 5:53 PM Jakub Herkel <jh...@gmail.com> wrote:

> Is there really nobody who could have any advice?
>
> jakub
>
> On Mon, Nov 9, 2020 at 6:06 PM John Neffenger <jo...@status6.com> wrote:
>
> > On 11/9/20 12:34 AM, Jakub Herkel wrote:
> > > These tags are parts of Java Compiler API. So for Java 10+ there is a
> new
> > > SUMMARY tag.
> >
> > While we're at it, there's also a handy new Javadoc tag for system
> > properties, available in Java 12, that I've noticed is missing in
> NetBeans:
> >
> > JEP draft: Guidelines for documenting system properties
> > https://openjdk.java.net/jeps/8214497
> >
> > More details are in the Compatibility & Specification Review below:
> >
> > Support {@systemProperty <name>} tag
> > https://bugs.openjdk.java.net/browse/JDK-8211132
> >
> > John
> >
> > ---------------------------------------------------------------------
> > 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: How to use different versions of javac api in netbeans sources

Posted by Davide Grandi <da...@email.it>.
sorry for the delay, I didn't notice that you question went unanswered.

I seldom encountered the need of having different version of a jar on 
the same JVM,
but in every case the anwser was loading different jars in different 
classloaders,
and executing things in different threads.
(obviously : if there are classes with same name and package)

bye,

     Davide

On 11/11/2020 17:53, Jakub Herkel wrote:
> Is there really nobody who could have any advice?
>
> jakub
>
> On Mon, Nov 9, 2020 at 6:06 PM John Neffenger <jo...@status6.com> wrote:
>
>> On 11/9/20 12:34 AM, Jakub Herkel wrote:
>>> These tags are parts of Java Compiler API. So for Java 10+ there is a new
>>> SUMMARY tag.
>> While we're at it, there's also a handy new Javadoc tag for system
>> properties, available in Java 12, that I've noticed is missing in NetBeans:
>>
>> JEP draft: Guidelines for documenting system properties
>> https://openjdk.java.net/jeps/8214497
>>
>> More details are in the Compatibility & Specification Review below:
>>
>> Support {@systemProperty <name>} tag
>> https://bugs.openjdk.java.net/browse/JDK-8211132
>>
>> John

-- 
Ing. Davide Grandi
email    : davide.grandi@email.it
mobile   : +39 339 7468 778
linkedin : http://linkedin.com/in/davidegrandi


---------------------------------------------------------------------
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: How to use different versions of javac api in netbeans sources

Posted by Jakub Herkel <jh...@gmail.com>.
Is there really nobody who could have any advice?

jakub

On Mon, Nov 9, 2020 at 6:06 PM John Neffenger <jo...@status6.com> wrote:

> On 11/9/20 12:34 AM, Jakub Herkel wrote:
> > These tags are parts of Java Compiler API. So for Java 10+ there is a new
> > SUMMARY tag.
>
> While we're at it, there's also a handy new Javadoc tag for system
> properties, available in Java 12, that I've noticed is missing in NetBeans:
>
> JEP draft: Guidelines for documenting system properties
> https://openjdk.java.net/jeps/8214497
>
> More details are in the Compatibility & Specification Review below:
>
> Support {@systemProperty <name>} tag
> https://bugs.openjdk.java.net/browse/JDK-8211132
>
> John
>
> ---------------------------------------------------------------------
> 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: How to use different versions of javac api in netbeans sources

Posted by John Neffenger <jo...@status6.com>.
On 11/9/20 12:34 AM, Jakub Herkel wrote:
> These tags are parts of Java Compiler API. So for Java 10+ there is a new
> SUMMARY tag.

While we're at it, there's also a handy new Javadoc tag for system 
properties, available in Java 12, that I've noticed is missing in NetBeans:

JEP draft: Guidelines for documenting system properties
https://openjdk.java.net/jeps/8214497

More details are in the Compatibility & Specification Review below:

Support {@systemProperty <name>} tag
https://bugs.openjdk.java.net/browse/JDK-8211132

John

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