0

I have found nothing to help me solve this problem, even though similar issue have been described in Stackoverflow, none which solve my problem. So here we go again.

I installed Android Studio in Ubuntu 14.04 (switching over from Windows 10). Followed the instructions as posted on Ubuntu site. Started a blank project and immediately got the following Gradle error:

Gradle sync started 8:54:11 PM Gradle sync failed: Process 'command '/opt/android-studio/jre/bin>/java'' finished with non-zero exit value 2

This is an empty project. All default settings. I'm at a loss. Maybe the ease with which I managed to get projects going in a Windows environment has led me towards unreasonable expectations with this Linux version... dunno.

Ali Bdeir
  • 4,151
  • 10
  • 57
  • 117
El Stepherino
  • 600
  • 6
  • 18

2 Answers2

2

I had this problem 2 days ago and changing the JDK path worked for me.. I downloaded Oracle jdk.. I hope that helps you and Happy coding.

DejaVu
  • 126
  • 1
  • 1
  • 4
2

I have just solved the problem ,I think there is a problem in the default jre that comes with the android-studio (..../android-studio/jre) you can change it and see if it works for you.

  • find the java installed directory readlink -f $(which java) will reveal the path, in my case /usr/lib/jvm/java-8-oracle/jre/bin/java
  • right click on project > open module settings then go to sdk location in the left panel set your jdk location.

if you don't have oracle jdk installed then you can try with openjdk .If it shows the same kind of error ,remove open jdk and install oracle jdk.

Hope it helps.

Mehedee Hassan
  • 133
  • 1
  • 9