First, this problem has troubled me for a long time, because it is not familiar with the new system, a headache when configuring java environment variables, can not find the JDK location, okay google wave and found this method.
First make sure to install the JDK
java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Client VM (build 25.65-b01, mixed mode)
Find java command position, pay attention to the graphical interface you can see this is a soft
which java
/usr/bin/java
Then look for java location
ls -l /usr/bin/java lrwxrwxrwx 1 root root 22 6月 27 2018 /usr/bin/java -> /etc/alternatives/java
According directory points to look for jdk directory
ls -l /etc/alternatives/java lrwxrwxrwx 1 root root 53 8月 24 19:16 /etc/alternatives/java -> /usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java
Finally, to get the directory jdk
/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java