Vscode-java: Java 11 minimum requirement needs clarification

Created on 24 Apr 2020  路  6Comments  路  Source: redhat-developer/vscode-java

This morning I have seen a notification from this extension in VSCode that "Java 11 will soon be the minimum requirement to run", linked to https://github.com/redhat-developer/vscode-java/wiki/JDK-Requirements#jdk11.requirement

I understand that this is due to upstream changes where it looks like the decision is already made and handled.

From a developers POV, great newer JDK, newer feature support, better security, etc 馃槂.

From a developer that has to work on corporate projects, I guess it means Ill soon be dropping VSCode.

I imagine there are other companies out there with the same stance; we have applications entailing millions of LOC in non-recent versions of Java. While these applications are still under development, there is no appetite from 'Those that Decide' to undertake the mammoth task of upgrading the applications, tooling, integration, testing etc to support newer versions of Java. It just isn't going to happen any time soon. (In my case the organisation is in the very _very_ drawn out process of upgrading to Java 8 only ... it took years to get that decision and it is taking years to enact it).

I understand that being an upstream change this is not within the control of this extension (though as RedHat, your opinion on the matter could hold some sway with Eclipse...). Proposal here then is thus: is it possible to make it easy to use, or pin an installation to, a specific version of this extension so that developers stuck in this situation can continue to use the older version of the extension, with the older JDK support ?

Most helpful comment

You'll still be able to compile your projects against Java 8. Java 11 will just be required to RUN the vscode extension

All 6 comments

You'll still be able to compile your projects against Java 8. Java 11 will just be required to RUN the vscode extension

On fedora, if I wanted to run my project with 1.8, would this be the appropriate way to do so? I'm unsure as I am still getting the warning about requiring java 11.

    "java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "/usr/lib/jvm/java-11-openjdk-11.0.6.10-0.fc31.x86_64",
            "default": true
        },
        {
            "name": "JavaSE-11",
            "path": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.fc31.x86_64",
        },
    ],

You should set the following properties:

"java.configuration.runtimes": [
        {
            "name": "JavaSE-11",
            "path": "/usr/lib/jvm/java-11-openjdk-11.0.6.10-0.fc31.x86_64"
        },
        {
            "name": "JavaSE-1.8",
            "path": "/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.fc31.x86_64",,
            "default": true
        },
    ],
"java.home": "/usr/lib/jvm/java-11-openjdk-11.0.6.10-0.fc31.x86_64", 

Your project should define the target Java version it should be compiled against, to ensure consistency across builds and platforms. When that is done, the default runtime doesn't matter, as the proper runtime from 'java.configuration.runtimes' is automatically used.

Thanks for clarifying @fbricon
Perhaps similar could be added to the requirements document to avoid confusion for others 馃檪

I updated the wiki after my initial comment

Was this page helpful?
0 / 5 - 0 ratings