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,090 points
2,467 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,890 points
1,334 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
• 53,090 points
933 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,090 points
2,325 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
241 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,420 points
496 views
0 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
271 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
41 views