Bug 271467

Summary: java/javavmwrapper: setting a JAVAVM_OPTS breaks jps
Product: Ports & Packages Reporter: Dmitry Afanasiev <KOT>
Component: Individual Port(s)Assignee: Greg Lewis <glewis>
Status: New ---    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (glewis)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Dmitry Afanasiev 2023-05-17 10:12:09 UTC
When JAVAVM_OPTS is set (locally, or using javavm_opts.conf) jps wrapper from this port breaks an original jps:
$ JAVAVM_OPTS=-Xmx1G
$ export JAVAVM_OPTS
$ jps
illegal argument: -Xmx1G
usage: jps [--help]
       jps [-q] [-mlvV] [<hostid>]

Definitions:
    <hostid>:      <hostname>[:<port>]
    -? -h --help -help: Print this help message and exit.

/usr/local/openjdk17/bin/jps does not accept arguments like -Xmx, -XX:MaxHeapSize and more.
As workaround JAVAVM_OPTS can be passed into a jps via environment variable _JAVA_OPTIONS