Unable to find JVM

A common issue you face when switching environment using conda or different envs depends on different Java version. Here is the solution.

Find where jdk installed

you can find the location using whereis java and which java(which only output the dir of Java that is currently used).

However, for linux Java is usually under /usr/lib/jvm/

choose the version you intend to use

I installed Java8 and Java11. Some reimplementation requires different versions of Java.

If I intend to use Java11 for this time, set its dir in environment variable: export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64