redhat-developer / redhat-developer/vscode-java
java has been set to 11 as default
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
Environment
- Operating System: Ubuntu 20.04
- JDK version: 8/11/17
- Visual Studio Code version: 1.78.2
- Java extension version: 0.25.11 (Extension pack for java)
Steps To Reproduce
- install java 17 (upgrade alternative to it)
- go to https://start.spring.io/ -> Gradle Groovy, Java, 3.1.0, jar, 17 and generate
- open it in vscode
Current Result
org.springframework.boot.gradle 3.1.0 can't be resolved,
(Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about its target Java environment (preferred optimized for standard JVMs))
the language support plugin is uses java 11 as default to import, even if the seourceCompatibility has been set and
the gradle.properties org.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64 on project level has been set (root folder)
The only way was to resolve is "java.import.gradle.java.home": "/usr/lib/jvm/java-1.17.0-openjdk-amd64", which is painful to figure out, intellij is behaving similarly (Gradle JVM needs to be set -> hasn't tested the gradle.properties in this case)
Expected Result
I would have expected:
a) whatever the JAVA_HOME sais, and the java.import.gradle.java.home is not set,
it's using the JAVA_HOME for gradle import also. (command line is using it)
b) if gradle.properties has been set is picking up java folder from there
It is the behavior being described in the official gradle manual.
Additional Informations
I'm using gradle for java plugin also.
The difference between intellij and vscode was, that the Gradle JVM had a default value. (randomly selected one)
After several attempt and screw up, cleaning up language server (ctrl+shift+p -> relevant command) didn't help, just removing all the workspace folder,
remove the project from workspace and restart and add back the project.
In this case java classes has been identified as non-project files!
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Java 17 を使用して start.spring.io から Gradle Groovy プロジェクトを再現し、インポート時に java.import.gradle.java.home、JAVA_HOME、プロジェクトの gradle.properties がどのように選択されるかを調査します。完了の条件は、拡張機能が明示的な設定を要求せずに期待される Java 17 runtime を使用し、Java クラスをプロジェクトファイルとして認識することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- build-system, devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100