From nobody Tue Oct 26 23:47:04 2021 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B500B1821D58 for ; Tue, 26 Oct 2021 23:47:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hf7lX3tz5z3DXv for ; Tue, 26 Oct 2021 23:47:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55DF02556E for ; Tue, 26 Oct 2021 23:47:04 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 19QNl4Uw095990 for ; Tue, 26 Oct 2021 23:47:04 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 19QNl4Ag095989 for ports-bugs@FreeBSD.org; Tue, 26 Oct 2021 23:47:04 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 259468] java/javavmwrapper: Add a java_home command? Date: Tue, 26 Oct 2021 23:47:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: tom@hur.st X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: glewis@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259468 Bug ID: 259468 Summary: java/javavmwrapper: Add a java_home command? Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: glewis@FreeBSD.org Reporter: tom@hur.st Flags: maintainer-feedback?(glewis@FreeBSD.org) Assignee: glewis@FreeBSD.org JRuby's launchers currently attempt to determine JAVA_HOME by resolving symlinks - it uses this mechanism to determine if the JVM has modules suppo= rt, which necessitates calling java with various `--add-opens` flags for fully-featured operation. This obviously doesn't work on FreeBSD, as it just resolves to /usr/local/b= in: https://github.com/jruby/jruby/issues/6905 Manually setting JAVA_HOME works around this, but is obviously not an ideal solution. The best fix would seem to be for javavmwrapper to offer a mechanism to determine the configured JAVA_HOME, and there seems to be precedent for suc= h a feature on other platforms which offer similar functionality in the form of= a `java_home` command: https://medium.com/notes-for-geeks/java-home-and-java-home-on-macos-f246cab= 643bd > java_home - return a value for $JAVA_HOME > > -v or --version version > Filters the returned JVMs by the major platform version in "JVMVersion= " form. > Example versions: "1.5+", or "1.6*". > -V or --verbose > Prints the matching list of JVMs and architectures to stderr. > --exec command ... > Executes the command at $JAVA_HOME/bin/ and passes the remain= ing arguments.=20 > Any arguments to select which $JAVA_HOME to use must precede the --exe= c option. For JRuby's purposes only the most basic functionality would be required, w= ith the rest perhaps a nice-to-have. This might also be nice for heavy Java users - manually setting JAVA_HOME c= uts out most of javavmwrapper's overheads (in my case, 95ms becomes 15ms), and = this would allow it to be set without manually hardcoding it. Does this seem reasonable? --=20 You are receiving this mail because: You are the assignee for the bug.=