Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no jdk found when opening pycharm?

Tags:

java

pycharm

i have installed pycharm but when i want to open it this error occurs.

No JDK found. Please validate either PYCHARM_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation.

but i have installed java.

output of echo $JAVA_HOME is /opt/java/jdk1.8.0_74/.

output of echo $PATH is /opt/java/jdk1.8.0_74//bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games.

what can i do?

like image 230
hamid Avatar asked Mar 07 '26 10:03

hamid


1 Answers

In my case helps

export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
export PYCHARM_JDK="/usr/lib/jvm/java-11-openjdk-amd64"

in .zshrc or in .bashrc file.

JAVA_HOME used to be enough, but after the update it started to work only after adding PYCHARM_JDK.

like image 108
Anshik Avatar answered Mar 08 '26 23:03

Anshik