I myself while studying java development and android development...
But in android for example, Java does not work on JVM and Dalvik VM and, accordingly, simple java code for android will not launch, except that it is to install android development environment intellij idea + open jdk.
Native language on Android segodnyashniy is kotlin, which also runs on the jvm and allowed to mix pieces of code even within the same class. With kotlin I don't know, and apps for Android write on java. As for the IDE, I usually use Android Studio or Intellij IDEA (by the way, Android Studio is based on Intellij IDEA Community Edition).