How can I add external library

I need to duplicate this pdf-raeder in Kotlin, so I downloaded the pdfbox-app-2.0.17.jar from here and added it to my project structure as External Library


And added it to the build.gradle as:

dependencies {
    testCompile("junit", "junit", "4.12")

But when tried to import it as:

import org.apache.pdfbox.pdmodel.PDDocument

I got an error:

Unresolved reference: pdfbox 

Why don’t you just use Gradle to download the dependency?

Simply add implementation("org.apache.pdfbox:pdfbox:2.0.17") to the dependencies block.


Thanks, but I need to lear how to handle such situation in case there is no maven.

You weren’t using maven, but gradle. In any case, if you use gradle you use gradle. If you mean without maven repositories, it is possible to add libraries from a project relative folder.

IIRC, if instead of entering a Maven co-ordinate string, you use a local file, it picks it up as if it was in a repo.