I don't know how to import packages from gradle dependancy

So i am using gradle to get dependencies from maven central which is working fine. I just don't know how to import them to my actual java file.

How do i found out the name to import it?

at the top of my java file i have to write

import <name>

How do i find the name?

Thank You.

Answers


According to your comments. You have to import the packages, which are contained within the library, not the library itself. There is no guarantee, this package names are the same as group or artifact id of the library. To get know that package names, usually you may use a javadocs for the library. Or just simply let your IDE to make it for you, them you're trying to use some classes from that lib.

Alternatively, you can use some off-sites, like mvnrepository.com, where you may find your library and take a look at the packages list within it. For example, description for Apache Commons Lang library, where you can see the "Packages" section with all the packages within the lib. You may import them, just like:

import org.apache.commons.lang3.*;

One more solution, is to unzip a jar and take a look into it's content to determine the packages structure.


Need Your Help

Do i login using cookies or sessions in a login system?

php ruby-on-rails cookies login session

Do i login using cookies or sessions in a login system? I've seen examples using sessions and cookies so i am confused! Can someone please explain this?

loadpixel() returns nullpointerexception

java nullpointerexception processing

I was using processing in netbeans to play a movie on an array of ledstrips and I am using OPC.class for ledstrip fadecandy mapping. This code works on the processing sketch, but when I tried to us...