Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 892253 - dev-util/idea-community: Idea does not work with non-binary JDK
Summary: dev-util/idea-community: Idea does not work with non-binary JDK
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mike Pagano
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-27 17:36 UTC by Maciej Barć
Modified: 2023-01-28 23:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Barć gentoo-dev 2023-01-27 17:36:27 UTC
> emerge dev-util/idea-community
> attempt to run idea-community - fail "No JRE found. Please make sure $IDEA_JDK, $JDK_HOME, or $JAVA_HOME point to valid JRE installation."
> look whet strace tries to open
> see:
> newfstatat(AT_FDCWD, "/opt/openjdk-17", 0x7ffceeb8b2a0, 0) = -1 ENOENT (No such file or directory)
> faccessat2(AT_FDCWD, "/opt/openjdk-bin-17/bin/java", X_OK, AT_EACCESS) = -1 ENOENT (No such file or directory)

only linking both non-binary jdk paths to the required locations works

> ln -s /usr/lib64/openjdk-17 /usr/lib64/openjdk-bin-17
> ln -s /usr/lib/jvm//openjdk-17 /opt/openjdk-17
Comment 1 Mike Pagano gentoo-dev 2023-01-28 19:15:55 UTC
Are JDK_HOME and JAVA_HOME set?

JDK_HOME=/etc/java-config-2/current-system-vm
JAVA_HOME=/etc/java-config-2/current-system-vm
Comment 2 Maciej Barć gentoo-dev 2023-01-28 19:18:31 UTC
> Are JDK_HOME and JAVA_HOME set?
> JDK_HOME=/etc/java-config-2/current-system-vm
> JAVA_HOME=/etc/java-config-2/current-system-vm

Yup.

> (~)λ echo $JDK_HOME                                                                           
> /etc/java-config-2/current-system-vm
> (~)λ echo $JAVA_HOME                                                                          
> /etc/java-config-2/current-system-vm
> (~)λ
Comment 3 Mike Pagano gentoo-dev 2023-01-28 20:36:57 UTC
I can't think of any reason not to patch line 56 of idea.sh from:

JRE="/opt/openjdk-bin-17" && [[ -d "/opt1/openjdk-17" ]] && JRE="/usr/lib64/openjdk-bin-17"
  JRE="${JDK_HOME}"

to

JRE="${JDK_HOME}"
Comment 4 Maciej Barć gentoo-dev 2023-01-28 20:41:18 UTC
(In reply to Mike Pagano from comment #3)
> I can't think of any reason not to patch line 56 of idea.sh from:
> 
> JRE="/opt/openjdk-bin-17" && [[ -d "/opt1/openjdk-17" ]] &&
> JRE="/usr/lib64/openjdk-bin-17"
>   JRE="${JDK_HOME}"
> 
> to
> 
> JRE="${JDK_HOME}"

Yup, following works on "this" machine.

> # shellcheck disable=SC2154
> if [ -n "$IDEA_JDK" ] && [ -x "$IDEA_JDK/bin/java" ]; then
>   JRE="$IDEA_JDK"
> else
>   ### JRE="/opt/openjdk-bin-17" && [[ -d "/opt/openjdk-17" ]] && > JRE="/usr/lib64/openjdk-bin-17"
>   JRE="${JDK_HOME}"
> fi
Comment 5 Mike Pagano gentoo-dev 2023-01-28 20:47:00 UTC
(In reply to Maciej Barć from comment #4)
> (In reply to Mike Pagano from comment #3)
> > I can't think of any reason not to patch line 56 of idea.sh from:
> > 
> > JRE="/opt/openjdk-bin-17" && [[ -d "/opt1/openjdk-17" ]] &&
> > JRE="/usr/lib64/openjdk-bin-17"
> >   JRE="${JDK_HOME}"
> > 
> > to
> > 
> > JRE="${JDK_HOME}"
> 
> Yup, following works on "this" machine.
> 
> > # shellcheck disable=SC2154
> > if [ -n "$IDEA_JDK" ] && [ -x "$IDEA_JDK/bin/java" ]; then
> >   JRE="$IDEA_JDK"
> > else
> >   ### JRE="/opt/openjdk-bin-17" && [[ -d "/opt/openjdk-17" ]] && > JRE="/usr/lib64/openjdk-bin-17"
> >   JRE="${JDK_HOME}"
> > fi

Thanks for the super quick responses.
Comment 6 Mike Pagano gentoo-dev 2023-01-28 21:01:02 UTC
Looks like we apply a patch that added that line, seems to work when I complete remove that else piece.  I'm going to drop that patch.
Comment 7 Larry the Git Cow gentoo-dev 2023-01-28 23:41:26 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffb2ede06368ce99a558de1717b3e9bbededf681

commit ffb2ede06368ce99a558de1717b3e9bbededf681
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2023-01-28 23:40:58 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2023-01-28 23:40:58 +0000

    dev-util/idea-community: Remove patch causing breakage setting JRE
    
    Closes: https://bugs.gentoo.org/892253
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 dev-util/idea-community/files/idea-community-jdk.patch | 11 -----------
 dev-util/idea-community/idea-community-2022.3.2.ebuild |  4 ----
 2 files changed, 15 deletions(-)