add this line /usr/lib/jvm/java-8-openjdk-amd64
to $HOME/.PyCharm2016.2/config/pycharm.jdk
file
and this line export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
to /etc/profile.d/oraclejdk.sh
file
Use source to load the variables, by running this command:
source /etc/profile.d/oraclejdk.sh
Then check the variable, by running this command:
echo $JAVA_HOME