You are not logged in.

#1 2024-06-23 10:15:56

mine_diver
Member
Registered: 2024-03-18
Posts: 62

[SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

Hello.

I have IntelliJ IDEA Community Edition installed from the Arch's extra repository.
Been having issues with markdown preview renderer. So much so that there was no option to show the preview in the first place.
So I tried installing a third party plugin that provides similar functionality to the built-in one, only to be greeted with this message on IDE restart:

Your environment does not support JCEF, cannot use Markdown Editor

So I went into the IDE's settings and found that there were a few bundled runtimes with JCEF support explicitly stated.
Chose the latest one of Java 17 and restarted, only to see the same exact message appear.

I take it that something makes IntelliJ always use the system runtime for whatever reason. Google isn't of much help.
Is it something known that can be fixed? Did I screw up somewhere? Thanks.

Last edited by mine_diver (2024-08-31 13:15:34)

Offline

#2 2024-06-23 22:31:34

mine_diver
Member
Registered: 2024-03-18
Posts: 62

Re: [SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

I've managed to somewhat solve this by manually setting the IDEA_JDK environment variable in my idea.desktop to the runtime with JCEF installed:

Exec=IDEA_JDK="/home/mine_diver/.jbr/jbr_jcef-17.0.11-linux-x64-b1207.24/" /usr/bin/idea %f

But it can't be the right solution, can it? Why does /usr/bin/idea choose the system runtime in the first place, if it's bound to break actual features?

Offline

#3 2024-06-23 22:55:33

mine_diver
Member
Registered: 2024-03-18
Posts: 62

Re: [SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

Well, found a related bug report - https://gitlab.archlinux.org/archlinux/ … -/issues/4

Offline

#4 2024-06-24 09:32:16

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,315

Re: [SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

But it can't be the right solution, can it? Why does /usr/bin/idea choose the system runtime in the first place, if it's bound to break actual features?

The JetBrains devs are the only ones that can answer that.

There have been bugreports for java apps where the answer was : we only support JBR and that doesn't have this issue. bug closed.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2024-08-31 13:14:18

mine_diver
Member
Registered: 2024-03-18
Posts: 62

Re: [SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

This seems to have been resolved with IntelliJ 2024.2.0.2, as it now recommends switching from "idea.sh" to the binary "idea", which natively supports changing the boot runtime. Marking as solved.

Last edited by mine_diver (2024-08-31 13:14:49)

Offline

#6 2025-06-01 01:22:01

tomikun
Member
Registered: 2025-06-01
Posts: 1

Re: [SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

It isn't fixed for me even on 2025.1, seems to be that the /usr/bin/idea script itself is broken. It sets the IDEA_JDK rather than JAVA_HOME.

/usr/share/idea/bin/idea.sh is what is used when restarting the IDE from within it and it checks IDEA_JDK first and then JAVA_HOME but the /usr/bin/idea script that official arch repos use overrides IDEA_JDK with java-21-openjdk.
/usr/share/idea/bin/idea seems to follow this same logic when I tested it, I can't figure out where the source for that file is though.

I was able to fix it by modifying /usr/bin/idea to just

#!/bin/sh
exec env JAVA_HOME="/usr/lib/jvm/java-21-openjdk/" /usr/share/idea/bin/idea "$@"
# vim: ts=2 sw=2 et:

thanks to the bugreport mentioned above saying that IDEA_CLASSPATH is defunct.

Seems to work. Didn't find any issues with it

Offline

#7 2025-09-21 14:40:11

qimuzi
Member
Registered: 2024-03-04
Posts: 1

Re: [SOLVED] Can't change boot Java runtime for IntelliJ IDEA Community

https://gitlab.archlinux.org/archlinux/ … type=heads

#!/bin/sh

if [ -z "$IDEA_JDK" ] ; then
  IDEA_JDK="/usr/lib/jvm/java-21-openjdk/"
fi
# open-jfx location that should match the JDK version
if [ -z "$IDEA_JFX" ] ; then
  IDEA_JFX="/usr/lib/jvm/java-21-openjfx/"
fi
# classpath according to defined JDK/JFX
if [ -z "$IDEA_CLASSPATH" ] ; then
  IDEA_CLASSPATH="${IDEA_JDK}/lib/*:${IDEA_JFX}/lib/*"
fi

exec env IDEA_JDK="$IDEA_JDK" IDEA_CLASSPATH="$IDEA_CLASSPATH" /usr/share/idea/bin/idea "$@"

# vim: ts=2 sw=2 et:

It rely on jdk21-openjdk in the extra responsibility.

Offline

Board footer

Powered by FluxBB