1) Open Project Structurethe menu Fileor use the shortcutctrl+alt+shift+S
2) SDKsis under Platform Settings. Select it and click green + at the top of the window.
3) Set the path to the JDK home directory (for example: /usr/lib/jvm/java-1.8.0-openjdk-amd64) and click Applyand OK.
Now you can execute your program.

source
share