Bug 268358 - devel/jetbrains-clion: give clion a hint to find JAVA_HOME
Summary: devel/jetbrains-clion: give clion a hint to find JAVA_HOME
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-13 14:38 UTC by Tobias C. Berner
Modified: 2022-12-13 15:37 UTC (History)
2 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
v1 (2.40 KB, patch)
2022-12-13 14:38 UTC, Tobias C. Berner
no flags Details | Diff
jetbrains-clion.diff (1.21 KB, patch)
2022-12-13 15:21 UTC, Dmitry Wagin
dmitry.wagin: maintainer-approval+
Details | Diff
jetbrains-clion.diff (1.70 KB, patch)
2022-12-13 15:27 UTC, Dmitry Wagin
dmitry.wagin: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias C. Berner freebsd_committer freebsd_triage 2022-12-13 14:38:59 UTC
Created attachment 238760 [details]
v1

Moin moin

clion can pick up the wrong JDK installation when multiples are installed, help it figure itself out:

https://people.freebsd.org/~tcberner/patches/0001-devel-jetbrains-clion-use-the-JAVA_HOME-defined-in-t.patch

mfg Tobias
Comment 1 Dmitry Wagin 2022-12-13 14:58:29 UTC
(In reply to Tobias C. Berner from comment #0)

Hello Tobias,

Good idea, i will investigate your solution and return with patch.
Comment 2 Dmitry Wagin 2022-12-13 15:21:29 UTC
Created attachment 238762 [details]
jetbrains-clion.diff
Comment 3 Dmitry Wagin 2022-12-13 15:27:06 UTC
Created attachment 238764 [details]
jetbrains-clion.diff

small fix
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-12-13 15:33:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4fecb327597025f0cd4d809c128279f12dacd5b7

commit 4fecb327597025f0cd4d809c128279f12dacd5b7
Author:     Dmitry Wagin <dmitry.wagin@ya.ru>
AuthorDate: 2022-12-13 15:32:03 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-12-13 15:32:03 +0000

    devel/jetbrains-clion: define default JAVA_HOME

    bin/clion tries to figure out the proper JAVA_HOME, while giving the
    user the ability to override it.

    This can lead to it picking up a too old Java version:

    > clion
       java.lang.UnsupportedClassVersionError:
       com/intellij/util/lang/PathClassLoader has been compiled by a more
       recent version of the Java Runtime (class file version 61.0), this
       version of the Java Runtime only recognizes class file versions up to
       52.0

    To fix this, make the ports tree fill in its JAVA_HOME into bin/clion.
    Users can still override it to something specific by overriding
    CLION_JDK:

    > env CLION_JDK=/some/other/jdk/installation clion

    PR:             268358

 devel/jetbrains-clion/Makefile               | 5 +++--
 devel/jetbrains-clion/files/clion.desktop.in | 2 +-
 devel/jetbrains-clion/files/clion.in         | 3 +++
 3 files changed, 7 insertions(+), 3 deletions(-)