You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Alex Kotchnev <ak...@gmail.com> on 2019/08/22 02:39:11 UTC

Replacing dependency on tools.jar in Java 11

The scala plugin that I'm trying to upgrade to Java 11 (
https://github.com/akochnev/ak_nbscala/tree/nb11-remove-impl-deps)  has a
system dependency on tools.jar from the JDK. That jar was removed from the
JDK (in Java 9, I think), and because of that, I can only compile the
plugin with Java 8. I looked around but didn't really find a way to replace
that dependency - it seems like Java 11 still somehow includes those
classes, but they're no longer in a jar file.

Any tips on how to best proceed with replacing this dependency with
whatever would work in java 11 ?

Cheers - Alex K

Re: Replacing dependency on tools.jar in Java 11

Posted by Alex Kotchnev <ak...@gmail.com>.
hey Chris - same here, nbscala has been on my guilty pleasures list for a
while. I'm not sure how much life there is left in it, but it's still fun
to get back into it. I did pull some of your changes (from the nb11 branch)
into my fork and removed a bunch of the implementation dependencies that
were a big PITA when installing into new versions of netbeans. I also
migrated the nbsbt to work with newer versions of sbt. Both now work but I
still need to do some cleanup. Having the build not fail because of these
missing tokens is one of the things that I def want to clean up as well.

Cheers - Alex K

On Fri, Aug 23, 2019 at 7:05 AM Luff,Chris <Ch...@cerner.com.invalid>
wrote:

> Hey all, this is a plugin I have put time into in the past - the whole
> thing needs to be modularised to take advantage of later JDK and Scala
> versions. I have started but time to work on it is limited. Additionally,
> some of the sub-projects are a little weirdly laid down so they probably
> need sorting to. You may be stuck with JDK 8 for now, which is by no means
> a bad thing!
>
>
> On 23 Aug 2019, at 12:14, Peter Hull <pe...@gmail.com> wrote:
>
> On Fri, Aug 23, 2019 at 4:41 AM Alex Kotchnev <ak...@gmail.com> wrote:
>
>   the code needs a few classes from the compiler tree API (e.g.
> com.sun.source.util - TreePath, Trees, etc). I looked around but couldn't
> find what dependency to add to the project instead. It seems that those
> classes are still available in newer SDKs, but the compilation fails in
> them.
>
> They have been put into the jdk.compiler module[1] so I think this
> means you'll have to 'modularise' your plugin, unless there's a legacy
> way to do it (personally I have not been able to figure out modules
> yet...)
> Pete
> [1]:
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.oracle.com%2Fen%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2Fjdk.compiler%2Fcom%2Fsun%2Fsource%2Futil%2Fpackage-summary.html&amp;data=02%7C01%7CChris.Luff%40cerner.com%7C04e7b1841a4241bda92708d727bb1e8f%7Cfbc493a80d244454a815f4ca58e8c09d%7C0%7C1%7C637021556935563115&amp;sdata=5bPY6IKljWF%2FEB7O%2FZKgcICwQ9YZ30Hs6mskP1l9Evg%3D&amp;reserved=0
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> <us...@netbeans.apache.org>
> For additional commands, e-mail: users-help@netbeans.apache.org
> <us...@netbeans.apache.org>
>
> For further information about the NetBeans mailing lists, visit:
>
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FNETBEANS%2FMailing%2Blists&amp;data=02%7C01%7CChris.Luff%40cerner.com%7C04e7b1841a4241bda92708d727bb1e8f%7Cfbc493a80d244454a815f4ca58e8c09d%7C0%7C1%7C637021556935563115&amp;sdata=AybTDR3M2qsqTZbnESNrkBNWcIcSlmLAypJEAvb4yk0%3D&amp;reserved=0
>
>
>
>
> CONFIDENTIALITY NOTICE This message and any included attachments are from
> Cerner Corporation and are intended only for the addressee. The information
> contained in this message is confidential and may constitute inside or
> non-public information under international, federal, or state securities
> laws. Unauthorized forwarding, printing, copying, distribution, or use of
> such information is strictly prohibited and may be unlawful. If you are not
> the addressee, please promptly delete this message and notify the sender of
> the delivery error by e-mail or you may call Cerner's corporate offices in
> Kansas City, Missouri, U.S.A at (+1) (816)221-1024. Cerner Limited,
> Registered in England no 2519305, Registered Office 37 North Wharf Road,
> London W2 1AF.
>

Re: Replacing dependency on tools.jar in Java 11

Posted by "Luff,Chris" <Ch...@Cerner.com.INVALID>.
Hey all, this is a plugin I have put time into in the past - the whole thing needs to be modularised to take advantage of later JDK and Scala versions. I have started but time to work on it is limited. Additionally, some of the sub-projects are a little weirdly laid down so they probably need sorting to. You may be stuck with JDK 8 for now, which is by no means a bad thing!


On 23 Aug 2019, at 12:14, Peter Hull <pe...@gmail.com>> wrote:

On Fri, Aug 23, 2019 at 4:41 AM Alex Kotchnev <ak...@gmail.com>> wrote:
  the code needs a few classes from the compiler tree API (e.g. com.sun.source.util - TreePath, Trees, etc). I looked around but couldn't find what dependency to add to the project instead. It seems that those classes are still available in newer SDKs, but the compilation fails in them.
They have been put into the jdk.compiler module[1] so I think this
means you'll have to 'modularise' your plugin, unless there's a legacy
way to do it (personally I have not been able to figure out modules
yet...)
Pete
[1]: https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.oracle.com%2Fen%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2Fjdk.compiler%2Fcom%2Fsun%2Fsource%2Futil%2Fpackage-summary.html&amp;data=02%7C01%7CChris.Luff%40cerner.com%7C04e7b1841a4241bda92708d727bb1e8f%7Cfbc493a80d244454a815f4ca58e8c09d%7C0%7C1%7C637021556935563115&amp;sdata=5bPY6IKljWF%2FEB7O%2FZKgcICwQ9YZ30Hs6mskP1l9Evg%3D&amp;reserved=0

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org<ma...@netbeans.apache.org>
For additional commands, e-mail: users-help@netbeans.apache.org<ma...@netbeans.apache.org>

For further information about the NetBeans mailing lists, visit:
https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FNETBEANS%2FMailing%2Blists&amp;data=02%7C01%7CChris.Luff%40cerner.com%7C04e7b1841a4241bda92708d727bb1e8f%7Cfbc493a80d244454a815f4ca58e8c09d%7C0%7C1%7C637021556935563115&amp;sdata=AybTDR3M2qsqTZbnESNrkBNWcIcSlmLAypJEAvb4yk0%3D&amp;reserved=0




CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. Cerner Limited, Registered in England no 2519305, Registered Office 37 North Wharf Road, London W2 1AF.

Re: Replacing dependency on tools.jar in Java 11

Posted by Peter Hull <pe...@gmail.com>.
On Fri, Aug 23, 2019 at 4:41 AM Alex Kotchnev <ak...@gmail.com> wrote:
>    the code needs a few classes from the compiler tree API (e.g. com.sun.source.util - TreePath, Trees, etc). I looked around but couldn't find what dependency to add to the project instead. It seems that those classes are still available in newer SDKs, but the compilation fails in them.
They have been put into the jdk.compiler module[1] so I think this
means you'll have to 'modularise' your plugin, unless there's a legacy
way to do it (personally I have not been able to figure out modules
yet...)
Pete
[1]: https://docs.oracle.com/en/java/javase/11/docs/api/jdk.compiler/com/sun/source/util/package-summary.html

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

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


Re: Replacing dependency on tools.jar in Java 11

Posted by Alex Kotchnev <ak...@gmail.com>.
Geertjan,
   the code needs a few classes from the compiler tree API (e.g.
com.sun.source.util - TreePath, Trees, etc). I looked around but couldn't
find what dependency to add to the project instead. It seems that those
classes are still available in newer SDKs, but the compilation fails in
them.

Cheers - Alex K

On Thu, Aug 22, 2019 at 12:53 AM Geertjan Wielenga <ge...@apache.org>
wrote:

> Why specifically is tools.jar needed, any way to avoid that? I don’t think
> it matters much if you end up requiring JDK 8. It’s a good one. :-)
>
> Gj
>
>
> On Thu, 22 Aug 2019 at 04:39, Alex Kotchnev <ak...@gmail.com> wrote:
>
>> The scala plugin that I'm trying to upgrade to Java 11 (
>> https://github.com/akochnev/ak_nbscala/tree/nb11-remove-impl-deps)  has
>> a system dependency on tools.jar from the JDK. That jar was removed from
>> the JDK (in Java 9, I think), and because of that, I can only compile the
>> plugin with Java 8. I looked around but didn't really find a way to replace
>> that dependency - it seems like Java 11 still somehow includes those
>> classes, but they're no longer in a jar file.
>>
>> Any tips on how to best proceed with replacing this dependency with
>> whatever would work in java 11 ?
>>
>> Cheers - Alex K
>>
>

Re: Replacing dependency on tools.jar in Java 11

Posted by Geertjan Wielenga <ge...@apache.org>.
Why specifically is tools.jar needed, any way to avoid that? I don’t think
it matters much if you end up requiring JDK 8. It’s a good one. :-)

Gj


On Thu, 22 Aug 2019 at 04:39, Alex Kotchnev <ak...@gmail.com> wrote:

> The scala plugin that I'm trying to upgrade to Java 11 (
> https://github.com/akochnev/ak_nbscala/tree/nb11-remove-impl-deps)  has a
> system dependency on tools.jar from the JDK. That jar was removed from the
> JDK (in Java 9, I think), and because of that, I can only compile the
> plugin with Java 8. I looked around but didn't really find a way to replace
> that dependency - it seems like Java 11 still somehow includes those
> classes, but they're no longer in a jar file.
>
> Any tips on how to best proceed with replacing this dependency with
> whatever would work in java 11 ?
>
> Cheers - Alex K
>