android5.0 compilation requires a jdk1.7 version, you may need to maintain two versions of JDK in the future, please refer to:
Online installation openjdk1.7
sudo apt-get install Openjdk-7-jre openjdk-7-jdk
Offline Bin package installation requires manual addition of configuration options
sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 50
Switch JDK version
sudo update-alternatives--config java
Toggle Javac Version
sudo update-alternatives--config javac
Note: If you only see partial JDK options, you need to add the. jinfo file yourself and register with Update-alternatives--install
Dynamic registration Java_home
java_home=$ (readlink-f/usr/bin/java | sed "S:bin/java::")
------------------------------------
By the way, the role of Javac and Java
Javac compiling Java files into class files
Java executes the class file.
Javac:java--->class
Java: Run class
android5.0 compiling