Can only start Pycharm manually calling pycharm.sh Follow
I don't know why but every time I try to start PyCharm after having go to Tools->Create Desktop Entry I get the following
Now, as I saw in some similar questions, I've added both JAVA_HOME and PYCHARM_JDK to my .zshrc file (I use oh-my-zsh)
# This is for Pycharm
export JAVA_HOME="/home/internetmosquito/.sdkman/candidates/java/current"
export JDK_HOME="/home/internetmosquito/.sdkman/candidates/java/current"
export PYCHARM_JDK="/home/internetmosquito/.sdkman/candidates/java/current"
By the way if you're wondering what .sdkman is, I use it to handle different Java versions, if you check what it points to, it's a valid Java installation
internetmosquito@internetmosquito-PE72-7RD ~ ls -ltra /home/internetmosquito/.sdkman/candidates/java
total 16
lrwxrwxrwx 1 internetmosquito internetmosquito 11 feb 10 20:24 current -> 11.0.2-open
drwxr-xr-x 9 internetmosquito internetmosquito 4096 feb 10 20:24 8u152-zulu
drwxr-xr-x 4 internetmosquito internetmosquito 4096 feb 10 20:24 .
drwxr-xr-x 8 internetmosquito internetmosquito 4096 feb 10 20:24 11.0.2-open
drwxr-xr-x 5 internetmosquito internetmosquito 4096 feb 10 20:24 ..
internetmosquito@internetmosquito-PE72-7RD ~ ls -ltra /home/internetmosquito/.sdkman/candidates/java/11.0.2-open
total 36
drwxr-xr-x 4 internetmosquito internetmosquito 4096 feb 10 20:24 ..
drwxr-xr-x 3 internetmosquito internetmosquito 4096 feb 10 20:24 include
drwxr-xr-x 2 internetmosquito internetmosquito 4096 feb 10 20:24 bin
drwxr-xr-x 6 internetmosquito internetmosquito 4096 feb 10 20:24 lib
-rw-r--r-- 1 internetmosquito internetmosquito 1214 feb 10 20:24 release
drwxr-xr-x 2 internetmosquito internetmosquito 4096 feb 10 20:24 jmods
drwxr-xr-x 72 internetmosquito internetmosquito 4096 feb 10 20:24 legal
drwxr-xr-x 8 internetmosquito internetmosquito 4096 feb 10 20:24 .
drwxr-xr-x 4 internetmosquito internetmosquito 4096 feb 10 20:24 conf
So if I try to echo any of those variables Pycharm is looking for, I get legit output...
internetmosquito@internetmosquito-PE72-7RD ~ echo $JAVA_HOME
/home/internetmosquito/.sdkman/candidates/java/current
internetmosquito@internetmosquito-PE72-7RD ~ echo $JDK_HOME
/home/internetmosquito/.sdkman/candidates/java/current
internetmosquito@internetmosquito-PE72-7RD ~ echo $PYCHARM_JDK
/home/internetmosquito/.sdkman/candidates/java/current
And obviously, java works fine
✘ internetmosquito@internetmosquito-PE72-7RD ~/Downloads/pycharm-2019.1/bin java -version
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
Funny thing is that if I run pycharm.sh manually in terminal, everything works fine...
internetmosquito@internetmosquito-PE72-7RD ~/Downloads/pycharm-2019.1/bin ./pycharm.sh
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.intellij.util.ReflectionUtil to field sun.awt.X11.XToolkit.awtAppClassName
WARNING: Please consider reporting this to the maintainers of com.intellij.util.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-02-14 21:47:41,590 [ 1332] WARN - llij.ide.plugins.PluginManager - Plugin "Markdown support" is incompatible (until build 173.SNAPSHOT < PY-193.7288.30)
2021-02-14 21:47:41,986 [ 1728] WARN - llij.ide.plugins.PluginManager - Plugin "Markdown support" is incompatible (until build 173.SNAPSHOT < PY-193.7288.30)
2021-02-14 21:47:42,469 [ 2211] WARN - com.intellij.ide.ui.LafManager - List.rowHeight = 0 in Darcula; it may lead to performance degradation
2021-02-14 21:47:42,473 [ 2215] WARN - com.intellij.ide.ui.LafManager - Table.rowHeight = 0 in Darcula; it may lead to performance degradation
2021-02-14 21:47:42,473 [ 2215] WARN - com.intellij.ide.ui.LafManager - Tree.rowHeight = 0 in Darcula; it may lead to performance degradation
2021-02-14 21:47:42,535 [ 2277] WARN - s.impl.EditorColorsManagerImpl - Cannot find scheme: VibrantInk from plugins: com.intellij.database
So...my take is that whenever I run this from a desktop entry, it simply doesn't get my env variables for some reason? Any pointers? Not sure if this is related with sdkman, but I had this working in the past coexisting with it without issues.
Please sign in to leave a comment.
Seems adding those to /etc/enviroment fixed the issue...yikes!