microsoft / microsoft/vscode-java-debug

Support use of environment variables in classPaths

Open
#1,276 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ai-triaged enhancement feature request launch
Dominant language
TypeScript
Stars
591
Forks
429
Avg merge
1d 9h
Merged PRs (30d)
19

Description

w.r.t. launch.json, this does not work:

"classPaths": [
                "$Auto",
                "$HOME/.m2/repository/com/oracle/database/jdbc/ojdbc10/19.15.0.0.1/ojdbc10-19.15.0.0.1.jar"
            ]

The classes pointed to by $HOME/.m2/repository/com/oracle/database/jdbc/ojdbc10/19.15.0.0.1/ojdbc10-19.15.0.0.1.jar are not available to the Java program.

if I replace $HOME with its actual value, it works e.g.:

"classPaths": [
                "$Auto",
                "/Users/me/.m2/repository/com/oracle/database/jdbc/ojdbc10/19.15.0.0.1/ojdbc10-19.15.0.0.1.jar"
            ]
Environment
  • Operating System: Mac OS Big Sur
  • JDK version: 17
  • Visual Studio Code version:

Version: 1.74.2 (Universal)
Commit: e8a3071ea4344d9d48ef8a4df2c097372b0c5161
Date: 2022-12-20T10:26:09.430Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin x64 20.6.0
Sandboxed: No

  • Java extension version:
  • Java Debugger extension version:
Steps To Reproduce
  1. [step 1]
  2. [step 2]

[attach a sample project reproducing the error]
attach logs

Current Result
Expected Result
Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how classPaths from launch.json are processed in the Java debugger, then reproduce the configuration using $HOME and the equivalent expanded path. Done means environment variables in classPaths resolve so the Java program can load classes from the referenced JAR.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
devtools
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.