Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

ErrorCorner

ErrorCorner Logo ErrorCorner Logo

ErrorCorner Navigation

  • Home
  • Contact Us
  • About Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Contact Us
  • About Us
Home/ Questions/Q 219
Next
Answered
Kenil Vasani
Kenil Vasani

Kenil Vasani

  • 646 Questions
  • 567 Answers
  • 77 Best Answers
  • 26 Points
View Profile
  • 0
Kenil Vasani
Asked: December 8, 20202020-12-08T03:29:26+00:00 2020-12-08T03:29:26+00:00In: ReactJs

Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation

  • 0

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ‘:react-native-linear-gradient:compileDebugJavaWithJavac’.

Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

When i upgraded to Mac os Big sur and run, npx react-native run-android I got this error(android). Done lot of solutions from stackoverflow, none of them are working.

I have created a fresh project and it’s working. Also some of the old projects are also working perfectly.

*react-native Version: "0.63.3",*

Please help me to find a solution ??????

androidreact-nativereact-native-android
  • 1 1 Answer
  • 44 Views
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    1 Answer

    • Voted
    1. Kenil Vasani

      Kenil Vasani

      • 646 Questions
      • 567 Answers
      • 77 Best Answers
      • 26 Points
      View Profile
      Best Answer
      Kenil Vasani
      2020-12-08T03:29:49+00:00Added an answer on December 8, 2020 at 3:29 am

      The problem is that with the update the built-in java took precedence and it doesn’t have the SDK because it’s just the runtime.

      You just need to change your java home and add the java binary to your .zshrc to find your java home execute:

      /usr/libexec/java_home -V | grep jdk
      

      the output should be similar to the following:

      Matching Java Virtual Machines (1):
      1.8.0_272 (x86_64) "AdoptOpenJDK" - "AdoptOpenJDK 8" /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
      /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
      

      you should take the path from the one that says SDK in my case

      /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
      

      after that, you just add the following to the end of your .zshrc that should be in your home.

      You can edit it with (if you decide to use vim you can exit writing :wq! and pressing enter)

      vim .zshrc
      

      add the following:

      export JAVA_HOME=the/path/you/copied/before
      export PATH=$JAVA_HOME/bin:$PATH
      

      where the/path/you/copied/before in my case would be

      /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home
      

      save the file and close all your terminals and open them again.

      The error should be solved.

      • 0
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp

    You must login to add an answer.

    Forgot Password?

    Sidebar

    Ask A Question
    • Popular
    • Kenil Vasani

      SyntaxError: invalid syntax to repo init in the AOSP code

      • 5 Answers
    • Kenil Vasani

      xlrd.biffh.XLRDError: Excel xlsx file; not supported

      • 3 Answers
    • Kenil Vasani

      Homebrew fails on MacOS Big Sur

      • 3 Answers
    • Kenil Vasani

      runtimeError: package fails to pass a sanity check for numpy ...

      • 3 Answers
    • Kenil Vasani

      Replicating claims as headers is deprecated and will removed from ...

      • 2 Answers

    Explore

    • Most Answered
    • Most Visited
    • Most Voted
    • Random

    © 2020-2021 ErrorCorner. All Rights Reserved
    by ErrorCorner.com