Change Java OpenJDK version in Arch Linux

Read Time:48 Second


  • When execute npm run android for React Native, the build error occurred as below:
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin ''.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `` in ``.


  • It’s because currently Java version is lower than 11.
  • Assuming already has another Java JDK, simply change Java for Arch Linux.
$ sudo archlinux-java status 
Available Java environments:
  java-8-openjdk (default)
$ sudo archlinux-java set java-17-openjdk
$ java -version
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment (build 17+35)
OpenJDK 64-Bit Server VM (build 17+35, mixed mode)


Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.