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
1,979 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
729 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
• 48,810 points
623 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
805 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
101 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,400 points
355 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
50 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
34 views