AndroidDev
AndroidDev

Reputation: 21237

Referencing a git repository in my Java File (Eclipse)

I'm creating a new Java project in Eclipse.

I want to be able to access code that I pulled from a Git repository.

I do not want to change the git code at all - I just need to import it into my code so that I can call its methods.

The git repository is all set up in Eclipse.

I can't figure out how to get my code to see it. I've tried importing JAR files, libraries, etc., but am not successful. Every tutorial I find just shows how to publish my own file to git, but not how to use a third-party repository.

If someone can refer me to an existing resource or question, that's fine too. Thanks!

enter image description here

Upvotes: 3

Views: 1294

Answers (1)

Manish Maheshwari
Manish Maheshwari

Reputation: 4134

Add the git repo to the Java Build Path in Eclipse.

Project->Properties->Java Build Path->Libraries->Add Class Folder -> Add the git repo folder, starting from the parent of "com/flickr" folder here.

Alternatively, Project->Properties->Java Build Path->Libraries->Add External Class Folder -> Add the git repo folder, starting from the parent of "com/flickr" folder here.

Clean and compile your project after adding the git repo to Java Build Path.

Upvotes: 2

Related Questions