Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find tools.jar React Native Android In windows 10

guys . i just try to install react native in my laptop. i've followed all setup instruction but i stiil get those error .

* What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Could not find tools.jar 

i used genymotion with os version 5.1.0, i've setup environment variable for android_home. Any idea what i miss here ?

sdk manager

like image 418
Ibnu Habibie Avatar asked Feb 08 '16 20:02

Ibnu Habibie


People also ask

Can't find tools jar contains a valid JDK installation Linux?

First of all Download And Install the JDK from the Oracle website with the same version number as the JRE if you didn't already. Then add JAVA_HOME to the environment variables of Windows. Restart your terminal or development environment to load the new JAVA_HOME value. Now, Your error must be solved.


2 Answers

Setting the missing "JAVA_HOME" system environment variable worked for me.

  • Press WIN+Pause on keyboard.
  • Click advanced system settings.
  • Click "Environment variables".
  • Click "New" under "System variables".
  • Type "JAVA_HOME" in the Variable name field.
  • Type the path to the JDK in the Value field. For me the correct path with short filename was "C:\PROGRA~1\Java\jdk1.8.0_66". Your path will vary depending on the installed version.
  • Click OK, and OK in previous window too.
  • Restart any command prompts or restart the computer.
  • react-native run-android worked fine after that.
like image 77
oldwizard Avatar answered Sep 20 '22 18:09

oldwizard


Setting up appropriate JDK (not JRE. JRE does not have tools.jar) version (E.g. JDK 1.7x) path as the JAVA_HOME would resolve this issue.

Please check your computer's environment variables and set JAVA_HOME if it has not already been setup.

like image 36
Rajkumar Nagarajan Avatar answered Sep 21 '22 18:09

Rajkumar Nagarajan