redhat-developer / redhat-developer/vscode-java
Unexpected "JRE container" entry derived from pom.xml for Java SE 13
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
When opening a Maven project which uses maven.compiler.source/target 13, the derived .classpath file uses J2SE-1.5 as its JRE container, instead of the expected JavaSE-12.
In other words: if the value for the Maven compiler properties is unsupported/unrecognized, it should default to the highest currently-supported version. This is much more likely to be what the user wants/expects. For example, with the new JDK release cadence (the first JDK 14 build is already released), it's more common (for me at least) to try out early-access JDK builds.
Environment
- Operating System: Windows 10 Pro 1809 (17763.557)
- JDK version: 12.0.1
- Visual Studio Code version: 1.35.1
- Java extension version: 0.46.0
Steps To Reproduce
- unzip and open sample-maven-project.zip
- let the extension generate the project files
Current Result
The .classpath file contains the following:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Expected Result
The .classpath file contains the following:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-12">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the Maven compiler properties in pom.xml are read and converted into the JRE container in the generated .classpath file. Reproduce the issue with the linked sample Maven project and check that an unsupported version selects the highest supported Java version instead of J2SE-1.5.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100