How can we add local jar file dependency to build gradle file

0 votes

So I have tried to add my local .jar file dependency to my build.gradle file. But I did not succeed. Can anyone guide?

Jun 27, 2018 in Java by Daisy
• 8,120 points
5,058 views

1 answer to this question.

0 votes

You can refer the below code if you need to take that .jar from a local directory, 

Add next to your module gradle (Not the app gradle file):

repositories 
{
   flatDir 
   {
       dirs 'libs'
   }
}


dependencies 
{
   compile name: 'gson-2.2.4'
}
answered Jun 27, 2018 by Akrati
• 960 points

Related Questions In Java

0 votes
2 answers

How can we add the local JAR files to the Maven Project in Java?

Firstly I would like to give credit ...READ MORE

answered Nov 5, 2018 in Java by Sushmita
• 6,910 points
10,396 views
0 votes
2 answers

How can we add leading zeros to the number in Java?

From Java 1.5 you can use the String.format method. ...READ MORE

answered Aug 26, 2019 in Java by Sirajul
• 59,230 points
4,662 views
0 votes
2 answers

How can we add an image to a JPanel?

If you are using JPanels, then are ...READ MORE

answered Sep 20, 2018 in Java by Daisy
• 8,120 points
10,986 views
0 votes
1 answer

How can we run the .jar file by double clicking on windows 7 (64)?

Use the following method to run the ...READ MORE

answered Jun 28, 2018 in Java by sharth
• 3,370 points
1,581 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,527 views
+2 votes
1 answer
0 votes
1 answer

How can we set environment variables from java?

For setting the environment variable, you can ...READ MORE

answered Jun 21, 2018 in Java by Akrati
• 960 points
3,442 views
0 votes
1 answer

How can we use java property files?

You can refer the below code: Properties properties ...READ MORE

answered Jun 28, 2018 in Java by Akrati
• 960 points
482 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP