Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix - Correct the gradle java version to jdt parsing #1590

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading