Skip to content

Commit

Permalink
fix - Correct the gradle java version to jdt parsing (#1590)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo committed Aug 26, 2024
1 parent 55e3b96 commit 4038148
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,23 @@ private JvmBuildTargetEx getJvmTarget(List<BuildTarget> buildTargets) throws Cor
/**
* Some legacy Gradle (e.g. v6) uses "1.9" and "1.10" to represent Java 9 and 10.
* We do a conversion here to make it compatible with Eclipse.
*
* Meanwhile, Gradle allows to set java version to 7, 8, etc...
* We also need to convert them to Eclipse compatible version.
*/
private String getEclipseCompatibleVersion(String javaVersion) {
if ("1.9".equals(javaVersion)) {
return "9";
if ("5".equals(javaVersion)) {
return JavaCore.VERSION_1_5;
} else if ("6".equals(javaVersion)) {
return JavaCore.VERSION_1_6;
} else if ("7".equals(javaVersion)) {
return JavaCore.VERSION_1_7;
} else if ("8".equals(javaVersion)) {
return JavaCore.VERSION_1_8;
} else if ("1.9".equals(javaVersion)) {
return JavaCore.VERSION_9;
} else if ("1.10".equals(javaVersion)) {
return "10";
return JavaCore.VERSION_10;
}

return javaVersion;
Expand Down

0 comments on commit 4038148

Please sign in to comment.