What's wrong with running the react-native app?

0

Hello, I'm trying to run my native react app through the

  

sudo react-native run-android

But I always get the following error message:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '11'.

I have tried everything

1- I tested the version of my java

  

java -version

openjdk version "11" 2018-09-25
OpenJDK Runtime Environment (build 11+24-Ubuntu-118.04)
OpenJDK 64-Bit Server VM (build 11+24-Ubuntu-118.04, mixed mode, sharing)

I've set JAVA_HOME, both in / etc / environment and ~ / .bashrc

  

echo $ JAVA_HOME

/usr/lib/jvm/java-11-openjdk-amd64

I really do not know what to do, because apparently the whole environment is prepared to work properly.

    
asked by anonymous 02.11.2018 / 20:42

1 answer

0

Good! then you can upgrade the gradle to see if it is compatible with OpenJDK 11

But I recommend using oracle jdk 8:

1 - Remove your open JDK 11 (if it is based on debian: apt purgue --remove openJDK *

2 - Download the Oracle JDK from SUN: link

3 - Unzip with: tar -zxvf

4 - Add in your PATH: I came ~ / .bashrc export export JAVA_HOME="/ local / do / JDK / jdk1.8.0_181" export CLASSPATH="$ JAVA_HOME / lib": $ CLASSPATH export PATH="$ JAVA_HOME / bin": $ PATH export MANPATH="$ JAVA_HOME / man": $ MANPATH

And after editing: source ~ / .bashrc

5 - Some cases java error, querying java -version Just follow this tip: link

After that java will be in version 8, and recommended for use.

    
14.11.2018 / 02:22