Java home supplied via 'org.gradle.java.home' is invalid. Invalid directory: /usr/local/java/jdk1.8.0_05

Solution 1:

Finally I found my solution. In the project root I found gradle.properties configure this java home

 org.gradle.java.home=/usr/local/java/jdk1.8.0_05

I remove and build it properly.

Solution 2:

  1. Check the global gradle configuration in C:\Users\<user>\.gradle

  2. In your android project you will have a file named gradle.properties

  3. Delete org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_144

Solution 3:

  1. In your android project you will have a file name gradle.properties.
  2. Open up that file, there will a line

org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_144

  1. You will have to change this line, insert your jdk setup location, most important use double backslashes "\\" like above in your path.