Command - Cordova run android

Asked

Viewed 203 times

0

I’m having trouble executing the command "$Cordova run android", see the line below after running the command;

$cordova run android
ANDROID_HOME=/home/dev3/Android/Sdk/
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
Error: Requirements check failed for JDK 1.8 or greater

The environment variable is set correctly in /etc/Nvironment.

$java -version
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-3~14.04.1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)

What may have occurred?

The questioning of the colleague led me to check if my environment variable was set correctly, when checking was correct but however the command

$javac -version --> estava apontando curiosamente para o jdk7;

Which led me to check and set through the update-alternatives command my $javac compiler

$sudo update-alternatives --config javac
Existem 2 escolhas para a alternativa javac (disponibiliza /usr/bin/javac).

  Selecção   Caminho                                      Prioridade Estado
------------------------------------------------------------
  0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      modo automático
  1            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      modo manual
* 2            /usr/lib/jvm/java-8-openjdk-amd64/bin/javac   1069      modo manual
  • The variable JAVA_HOME should I really point into the JVM folder? That doesn’t seem to make sense to me.

  • jbueno all versions of java usually stay inside /usr/lib/jvm/"versaodojava"

  • but your query helped me solve the problem, , the javac -version command was pointing to jdk7 , so I set it to jdk 8 , with the update-alternatives command -config javac , and set it to jdk8

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.