diff --git a/org.eclipse.m2e.jdt.tests/projects/basicProjectWithDep/pom.xml b/org.eclipse.m2e.jdt.tests/projects/basicProjectWithDep/pom.xml index 19d85185fa..21b3ab716a 100644 --- a/org.eclipse.m2e.jdt.tests/projects/basicProjectWithDep/pom.xml +++ b/org.eclipse.m2e.jdt.tests/projects/basicProjectWithDep/pom.xml @@ -3,12 +3,17 @@ ewq bugM2e2 0.0.1-SNAPSHOT - - - - org.apache.logging.log4j - log4j-core - 2.17.1 - - + + + 1.8 + 1.8 + + + + + org.apache.logging.log4j + log4j-core + 2.17.1 + + \ No newline at end of file diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/LookupJDKToolchainsJob.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/LookupJDKToolchainsJob.java index b3df0411a7..8f1f5253e0 100644 --- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/LookupJDKToolchainsJob.java +++ b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/LookupJDKToolchainsJob.java @@ -82,18 +82,16 @@ private void addToolchain(ToolchainModel toolchain) { .noneMatch(install -> isSameCanonicalFile(candidate, install))) { VMStandin workingCopy = new VMStandin(standardType, candidate.getAbsolutePath()); workingCopy.setInstallLocation(candidate); - if (workingCopy.getJavaVersion() != null) { - String name = candidate.getName(); - int i = 1; - while (isDuplicateName(name)) { - name = candidate.getName() + '(' + i++ + ')'; - } - workingCopy.setName(name); - IVMInstall newVM = workingCopy.convertToRealVM(); - // next lines workaround https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/248 - if (!(newVM instanceof IVMInstall2 newVM2 && newVM2.getJavaVersion() != null)) { - standardType.disposeVMInstall(newVM.getId()); - } + String name = candidate.getName(); + int i = 1; + while (isDuplicateName(name)) { + name = candidate.getName() + '(' + i++ + ')'; + } + workingCopy.setName(name); + IVMInstall newVM = workingCopy.convertToRealVM(); + // next lines workaround https://github.com/eclipse-jdt/eclipse.jdt.debug/issues/248 + if (!(newVM instanceof IVMInstall2 newVM2 && newVM2.getJavaVersion() != null)) { + standardType.disposeVMInstall(newVM.getId()); } } });