redhat-developer / redhat-developer/vscode-java
Java Runtime incorrect, when using gradle toolchains
オープン
まだ誰も着手していません。
Gradle
runtime
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
I am using the following build.gradle file:
plugins {
// Apply the java-library plugin for API and implementation separation.
id 'java-library'
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}
dependencies {
// Use JUnit test framework.
testImplementation 'junit:junit:4.13'
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'
// Java Parser and Code Generator
implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.24.7'
}
It uses the Java 1.17 toolchain, however in the Configure Java Runtime Tab, it shows Java Version 12:
When I try to use newer Java features, it shows the following Error:
The Java feature 'Text Blocks' is only available with source level 15 and above
Environment
- Operating System: Windows 10
- JDK version: 1.17
- Visual Studio Code version:
- Java extension version: 1.12.0
- Gradle version: 7.0.0
Steps To Reproduce
Sample Project: java-rewriter.zip
- open lib/src/test/java/dev/levno/javarewriter/LibraryTest.java in vscode
- Error is shown
Current Result
Error is displayed in File
Expected Result
No Error should be displayed
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
サンプルプロジェクトの build.gradle と lib/src/test/java/dev/levno/javarewriter/LibraryTest.java から始め、次に VS Code で診断を再現して Configure Java Runtime タブを確認します。Java 17 Gradle ツールチェーンを使用するプロジェクトで、テキストブロックのソースレベルエラーが報告されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100