how to set a dependency in module on the NetBeans Lookup API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to set a dependency in module on the NetBeans Lookup API

ireneh
I'm trying to work my way through the tutorial "NetBeans Platform Quick Start Using Maven" and having issues that I cannot resolve by searching this forum or stack exchange as the answers are old and Netbeans has changed since then.

I get about 80% of the way through, then get an error
error: package org.openide.util.lookup does not exist

There is a tip in the tutorial
"To use the @ServiceProvider annotation, you need to set a dependency in your module on the NetBeans Lookup API. When the module is compiled, a NetBeans annotation processor will create a META-INF/services folder with a file named after the interface, containing the name of the implementing class. Via Lookup.getDefault, in the next section in this tutorial, the file will be found and, from there, the class implementing the requested interface will be loaded."

How, exactly do I set a dependency in your module on the NetBeans Lookup API in Netbeans 8.1?

However without any instructions how to do this, the tip is not that helpful.




Reply | Threaded
Open this post in threaded view
|

how to set a dependency in module on the NetBeans Lookup API

ireneh
found it.

right click Dependencies->Add dependency

in the query type "openide"

a number of libraries will list. click the "+" by the "org-openide-util-lookup"
entry and pick a version of the library.




Reply | Threaded
Open this post in threaded view
|

Re: how to set a dependency in module on the NetBeans Lookup API

geertjan.wielenga@oracle.com
In reply to this post by ireneh

Highly recommend you get the book: leanpub.com/nbp4beginners


Geertjan Wielenga | Principal Product Manager
Phone: +31620320056 | 
Oracle Developer Tools

ORACLE Netherlands | Hertogswetering 163-167 | 3543 AS Utrecht | Netherlands


Oracle is committed to developing practices and products that help protect the environment

On 30 Sep 2017, at 17:26, ireneh <[hidden email]> wrote:

I'm trying to work my way through the tutorial "NetBeans Platform Quick Start Using Maven" and having issues that I cannot resolve by searching this forum or stack exchange as the answers are old and Netbeans has changed since then. 

I get about 80% of the way through, then get an error
error: package org.openide.util.lookup does not exist

There is a tip in the tutorial
"To use the @ServiceProvider annotation, you need to set a dependency in your module on the NetBeans Lookup API. When the module is compiled, a NetBeans annotation processor will create a META-INF/services folder with a file named after the interface, containing the name of the implementing class. Via Lookup.getDefault, in the next section in this tutorial, the file will be found and, from there, the class implementing the requested interface will be loaded."

How, exactly do I set a dependency in your module on the NetBeans Lookup API in Netbeans 8.1?

However without any instructions how to do this, the tip is not that helpful.