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,050 points
1,162 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,870 points
138 views
0 votes
1 answer

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

To add zeros to a number, we ...READ MORE

answered May 25, 2018 in Java by Akrati
• 3,150 points
189 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,050 points
63 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,320 points
25 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,380 points
124 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
24 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
16 views