1

I have this problem when I import a project to Android Studio. Can anyone help please?!!

Error:Execution failed for task ':baseGameUtils:compileReleaseJava'.

Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

Grey Ish
  • 13
  • 3
  • you have to install the java jdk in your computor http://www.oracle.com/technetwork/java/javase/downloads/index.html if is it installed config your JAVA_HOME var in system environnement – Crammeur Nov 10 '17 at 23:31
  • computer* sorry for my english – Crammeur Nov 10 '17 at 23:37
  • 1
    hello there, I have already installed java on my computer and config its environment. – Grey Ish Nov 10 '17 at 23:51
  • ok so i don't know why – Crammeur Nov 10 '17 at 23:52
  • Try on Android Studio File -> Invalidate Caches / Restart – Crammeur Nov 11 '17 at 00:02
  • Check on Android Studio in File -> Project Structure if your jdk is config – Crammeur Nov 11 '17 at 00:11
  • Possible duplicate of [Running Gradle project via Eclipse errors "system Cannot find System Java Compiler"](https://stackoverflow.com/questions/16913397/running-gradle-project-via-eclipse-errors-system-cannot-find-system-java-compil) – Zoe Nov 11 '17 at 10:31
  • I have this problem with android studio whenever I try ti uncheck "Use Embedded JDK" and redefine the path of the jdk, it doesn't want to be applied the "apply" button doesn't work and when I click OK nothing changes and the "use embedded jdk" remains checked!! – Grey Ish Nov 11 '17 at 11:10

2 Answers2

0

They are two option if your are on Windows

Option 1

If you don't have java jdk installed in your you need to install it.

download link : http://www.oracle.com/technetwork/java/javase/downloads/index.html

Option 2

If is it installed you have to config your windows environement. I suggest you to add it in System variables

enter image description here

Crammeur
  • 678
  • 7
  • 17
  • hello there, well I have all that installed and configured. I have worked with other codes before, however this one present me with this error I dont know why?? – Grey Ish Nov 10 '17 at 23:54
0

First of all, you need to download the JDK (if you don't have it installed, check it out on the Installed Programs on the Control Panel) from here. After installing it you need to create an environment variable called JAVA_HOME. To add it...

  1. Open the Windows Explorer (Win key + E), and right click on This Computer > Properties. Picture of Step 1.
  2. On the following window choose "Advanced System Configuration" located on the left pane, and then click on the button "Environment Variables".
  3. On the following window, under the "System variables" group, click on "New".
  4. Set JAVA_HOME as the variable name, and for the name of the variable set it like this: C:\Program Files\Java\jre_java_version where java_version is the version of the installed JRE.
  5. Click Accept and you should have something like this: Picture of Step 2.

And that's it!

Community
  • 1
  • 1
Jesús Hagiwara
  • 363
  • 2
  • 8
  • 14
  • I have all that sorted out. and I have worked with other codes earlier with no problem whatsoever. I think this code might have some problems with its gradle build (as I have read elsewhere. still unsolved yet!! – Grey Ish Nov 11 '17 at 11:19