[BUG] JAVA_OPTS is incorrectly evaluated
@kay-schecker 已经在做这个了。
开始于 2026年6月2日。
评估
这个 Issue 还没有评估数据。
描述
🐛 Bug Report:
Describe the bug
The content of the environment variable JAVA_OPTS is evaluated. In case it contains a | character, then the next part of it is interpreted as a new command.
I'm in a corporate network that is secured by a proxy. My JAVA_OPTS environment variable defines the settings so that Java can use the proxy:
$ env | grep JAVA_OPTS
JAVA_OPTS=-Dhttp.proxyHost=localhost -Dhttp.proxyPort=9000 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=9000 -Dhttp.nonProxyHosts=127.*|localhost|*.local
$
The http.nonProxyHosts contains the | character as described by Java. The normal Java applications accept this environment variable correctly.
Steps to Reproduce
Steps to reproduce the behavior:
- Go to en empty directory.
- Install the cli:
npm install -g @openapitools/openapi-generator-cli - Call the generator without a
|in theJAVA_OPTS:
JAVA_OPTS="-Dhttp.nonProxyHosts=localhost" openapi-generator-cli help - Call the generator with a
|in theJAVA_OPTS:
JAVA_OPTS="-Dhttp.nonProxyHosts=127.*|localhost" openapi-generator-cli help
Actuall response
The command from point 4. returns the error message:
Error: 'localhost' is not recognized as an internal or external command,
operable program or batch file.
at C:\Users\S230984\AppData\Local\nvm\v22.22.3\node_modules\@openapitools\openapi-generator-cli\main.js:2:51423
at ChildProcess.exithandler (node:child_process:424:5)
at ChildProcess.emit (node:events:519:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:304:5)
Node.js v22.22.3
Expected behavior
The command from point 3. returns a correct help response. The command from point 4. should return the same response.
Screenshots
N/A
Operation System (please complete the following information):
- OS: Windows with a git-bash
- Version 11
Package System (please complete the following information):
- Version: Node.js 22
Additional context
I expect that the problem is that the java command with paramaters is evaluated too much. There are somewhere quotes missing. During the evaluation, the | character is then interpreted by the shell as a command pipe end the next part is expected to be a command (which it isn't). Additional quotes inside my environment variable is not needed. The normal shell doesn't automatically evaluate the content as a pipe. The following command (without additional quotes) returns the correct output:
$ echo $JAVA_OPTS
-Dhttp.proxyHost=localhost -Dhttp.proxyPort=9000 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=9000 -Dhttp.nonProxyHosts=127.*|localhost|*.local
$
- 主要语言
- TypeScript
- 星标
- 2k
- 派生
- 208
- 平均合并
- 7 小时 12 分钟
- 30 天内合并 PR
- 6
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenAPITools/openapi-generator-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
-
[BUG] Proxy configuration of NPM not used when downloading .jar via version manager可能重新可做 @kay-schecker 于 170 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1190 · 已指派 1 人 ·
-
[BUG] openapiGeneratorIgnoreList is missing from schema可能重新可做 @kay-schecker 于 220 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1138 · 1 条评论 · 已指派 1 人 ·
-
[BUG] Environment variable not found (missing .env loading)可能重新可做 @kay-schecker 于 259 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#1094 · 1 条评论 · 已指派 1 人 ·
-
[BUG] Unable to access files when useDocker is true and SELinux is enabled可能重新可做 @kay-schecker 于 381 天前认领,目前没有进行中的 PR。 未关闭bug
OpenAPITools/openapi-generator-cli#991 · 已指派 1 人 ·
查看 OpenAPITools/openapi-generator-cli 的全部 Issue
相似的 Issue
-
ADD openalgo未关闭template
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
bug Needs: Triage :mag:
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/fluentui-contrib#671 ·
-
难度 2/5 1-3 小时 新手友好度 88/100
sveltejs/acorn-typescript#150 ·
-
难度 2/5 1-3 小时 新手友好度 78/100