My react native android was compiling fine until I added react-native-firebase as per the docs (ios compiles fine).
React Native 0.63.2 and react-native-firebase 8.3.0 latest versions
and followed docs very carefully. OSX 10.15.6
Deleted/cleared/reinstalled gradle and android gradle/build dirs etc.
java JRE v8.202 /Library/Internet Plug-Ins/JavaAppletPlugin.plugin
java JRE v8.202 /Library/Java/JavaVirtualMachines
Note that JAVA_HOME path set to /Applications/AndroidStudio.app/Contents/jre/jd/Contents/Home
Error:
> Task :react-native-firebase_app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-firebase_app:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.
I'm using Mac Bigsur beta 4, and I have the same problem.
I tried uninstalling java by following the steps in this link:
https://www.java.com/en/download/help/mac_uninstall_java.xml
After that I checked the java version in terminal using: java -version.
The uninstall process didn't work. However, running react-native run-android now works.
Try this. It may work for you.
Note: If you tried uninstalling java, and running react-native run-android still doesn't work, add this to bash_profile and try again: export JAVA_HOME=/Applications/AndroidStudio.app/Contents/jre/jdk/Contents/Home
Ran source ~/.bash_profile to ensure JAVA_HOME path set to /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home and it compiled, yay.
Related
After upgrading my macOS to Big Sur, I have not been able to run my grails application. I keep getting this error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':server:compileGroovy'.
Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.
I have reinstalled java, but still getting the same error.
Use this command to see java paths: /usr/libexec/java_home -V | grep jdk
Copying tools.jar in /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/lib/ to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/ solved the problem.
My operating system is Pop!_OS 20.10. I am simply trying to run a flutter project, which I created on IntelliJ, on my android device using IntelliJ IDEA. The build is being completed without any errors but when running the app, it says that my JAVA_HOME variable is set to an invalid directory:
Launching lib/main.dart on Mi A2 in debug mode...
Running Gradle task 'assembleDebug'...
ERROR: JAVA_HOME is set to an invalid directory: /app/extra/idea-IU/jre64
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
Exception: Gradle task assembleDebug failed with exit code 1
SDKs installed on my platform settings are openjdk-15.0.2, corretto-1.8 and Android API 30 Platform. I didn't manually altered any environment variables before getting this error. After this, I tried to add JAVA_HOME variable to ~/.bashrc and /etc/environment files to point my JDK installation folder like this:
JAVA_HOME="/usr/lib/jvm/default-java"
and also tried with my current java installation:
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
but no luck. I did a lot of research and really don't know what to do at this point.
There are two possibilities
1 - Your flutter sdk is may be some old version. Run flutter upgrade to update your flutter sdk.
2 - You might not have installed JDK or the JDK Path is not set in Environment Variables.
I was trying to install Xuggle on Ubuntu with this tutorial
But when I used ant stage it doesn`t work. I see these commands on the terminal
> root#test1:~# ant stage Unable to locate tools.jar. Expected to find
> it in /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar Buildfile:
> build.xml does not exist! Build failed
Do you have any idea how I can fix it?
The tools.jar error will be because ant can't find your JDK, it appears to be looking in the open JDK location. You might need to install oracle-java7-set-default so it points your system java to the oracle java you just installed.
I'm trying to run the maven and returns me the error:
/opt/apache-maven-3.3.3/bin/mvn: 227: exec: /opt/jdk1.7.0_79/bin/java: not found
What can it be?
run the command echo $JAVA_HOME and see where the java home is set and verify if the path is correct. Then check if $JAVA_HOME\bin\ folder is there and check for java command in it.
I just was experiencing this same problem, and about 4 hours later I figured it out. I had installed the wrong version of the java JDK. I originally installed the Linux x-86 version, but my computer settings required the x-64 version. Make sure you have the version of the Java JDK that is compatible with your system. Here's the link to those JDK downloads: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I installed Java 8 SDK (with update 25 for JRE) from the Oracle Java site using the instructions on this page
http://docs.oracle.com/javase/8/docs/technotes/guides/install/mac_jdk.html
and put the following line in my ~/.bash_profile
export JAVA_HOME="/usr/libexec/java_home -v 1.8"
but when I try to compile or run a Java program in Bash I get the following message
No Java runtime present, requesting install.
and this window
I ran /usr/libexec/java_home to check:
$ /usr/libexec/java_home
Unable to find any JVMs matching version "(null)".
No Java runtime present, try --request to install.
But the JRE is in
/System/Library/Frameworks/JavaVM.framework/Versions/Current
and the JRE location in System Preferences is pointing to
/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin
I don't know what the problem is here, but usr/bin/javac and /usr/bin/java are not able to find the correct JVM location in /System/Library/Frameworks/JavaVM.framework/Versions/Current.
I have encountered the same problem , i think you should install JDK but not JRE
You need to add some backticks:
export JAVA_HOME="`/usr/libexec/java_home -v 1.8`"
The /usr/libexec/java_home command outputs the right value for JAVA_HOME on its standard output, you need to use backticks to capture that value so you can store it in the variable.
But the JRE is in /System/Library/Frameworks/JavaVM.framework/Versions/Current
No, it isn't. The Oracle JRE installs itself under /Library/Internet Plug-Ins, the Oracle JDK installs under /Library/Java/JavaVirtualMachines. The binaries under /usr/bin and /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands are stubs that delegate to whichever JDK your JAVA_HOME variable points to.
Here's how I solved my problem on my mac
Check from RStudio if Java_HOME has been setup properly by running Sys.getenv("JAVA_HOME") in the console. If it returns blank, you need to set it up properly
Check whether you have Java SDK installed
Open terminal and check if you have Java SDK installed
Run the /usr/libexec/java_home -vcommand. This will show you the library where you Java SDK is installed.
If you don't have Java SDK installed yet, result from command above is blank, or the version is not up-to-date, download here and install the latest version.
Copy the library shown in step 2. On my mac, it shows:
/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home
Back on your RStudio console, set the JAVA_HOME
Sys.setenv(JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home")
After doing the steps above, h2o.init() ran without hitch.
Please carefully note #Ian Robert's point on JRE vs JDK distinction. We need JDK to make h2o run.
I've tried several solutions, downloading several sdk but Android Studio didn't recognize them as valid sdks.
Finally, the workaround that worked for me was:
Delete Android Studio.app and Android Studio preferences (~/Library/Preferences/AndroidStuido).
Rename /usr/libexec/java_home to java_home.bak.
Install again Android Stuido.
When Android Studio prompts for a valid Java SDK, follow link provided by Android Studio and download that java installation.
After installation, push detect button on Android Studio, and run.