redhat-developer / redhat-developer/vscode-java
java has been set to 11 as default
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 2.3k
- Forks
- 546
- Merge moyen
- 20 h 1 min
- PR mergées (30 j)
- 11
Description
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!
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le projet Gradle Groovy depuis start.spring.io avec Java 17, puis examinez comment java.import.gradle.java.home, JAVA_HOME et le gradle.properties du projet sont sélectionnés lors de l’importation. Le travail est terminé lorsque l’extension utilise le runtime Java 17 attendu sans nécessiter le paramètre explicite et reconnaît les classes Java comme des fichiers du projet.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java
- Domaine
- build-system, devtools
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100