Building applications with React Native on Linux and macOS usually need some extra configuration like set environment variables that sometimes are not clear about where or how to put them.

Since right now I am using Arch Linux in my second computer, I decided to configure it to develop a React Native application so I installed everything and at the moment to run the app with

react-native run-android

I got some errors regarding the version of the Java, the environment variable some others so in order to run your app correctly, you must perform the following steps

  1. Install sudo pacman -S jdk8-openjdk because with Java 10, I couldn’t run the app (at least for me)
  2. Add JAVA_HOME to your .bash_profile file export JAVA_HOME=/usr/lib/jvm/default
  3. List your Java environments with archlinux-java status
  4. Set a default Java environment with archlinux-java set [java-8-openjdk] or the one printed in the previous command
  5. Finally source ~/.bash_profile

With those simple steps you will be able to run your react-native application on Arch Linux.