redhat-developer / redhat-developer/vscode-java

java.home Path Cannot be Relative

オープン
#1,070 コメント 1 件 リアクション 5 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement preferences ux
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

I need to be able to use a relative path when specifying my jdk because I am making a USB version of visual studio that can be used on any computer. If that USB is in the E: (or any other) drive instead of the regular D: we’d have to manually change the path. The python module was able to use a combination of “..\..\” (Example below) to navigate to the relative location of python.exe. Is there a way to do this for the java.home variable, or an extension that adds this functionality?

In Settings.json:
"java.home": "..\..\..\..\..\..\Java12\jdk-12.0.2", //Doesn’t work
"python.pythonPath": "..\..\..\..\..\..\Python\python.exe", //Works

Environment
  • Operating System: Windows
  • JDK version: 12.0.2
  • Visual Studio Code version: 1.38.1
  • Java extension version: Redhat: 0.49.0; Java Extension Pack: 0.8.0
Steps To Reproduce
  1. Download VS Code Windows ZIP archive into a USB disk
  2. Enable the VS Code portable mode (creating “data” folder) https://code.visualstudio.com/docs/editor/portable
  3. Download the JDK binary into the USB disk
  4. Open the VS Code and install the Java Pack extension, the extensions should appear in the data folder
  5. Try and set Java.home to a relative location to VS Code, however it will never find the jdk unless you specify the entire path
Current Result

It cannot find the jdk without the entire path.

Expected Result

The path should point to the JDK relative to VSCode (or some starting position within vscode)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Settings.json の java.home 設定から始め、issue に記載された Windows portable-mode の再現を使って、その処理を python.pythonPath と比較します。Java 拡張機能が JDK のパスをどのように解決するかを追跡し、相対パスの基準位置として意図されている場所を明確にします。異なるドライブレターから絶対パスなしで USB レイアウトが機能すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, typescript, vscode
領域
developer-experience, tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
32/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。