Programming memorandum from 51 years old (currently 52) java.awt javax.swing in VScode // Java 11 or more recent is required to run

I was reviewing java with VScode When trying to check the behavior of JFrame

VScode「vscode Java 11 or more recent is required to run...」

I "Hmm"

Import java.awt javax.swing with VScode

In my case, the jdk used in eclipse is ver8, so it is assumed that I want to align VScode with ver8 as well.

  1. Specify the path of jdk 8 in the environment settings on the windows side (omitted)
  2. Specify 2 items in settings.json on VScode side
  3. Version change of Language Suport for java on VScode side

Will come

Will this error be fixed when the JDK is updated in September 2020 and when VScode supports it? So, this article is a limited article so far.

2.setting.json Specifying jdk in java.home Specifying jdk in java.configuration.runtimes

    "java.home": "C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.262.10-openj9",
    "java.configuration.runtimes": [  
        {
          "default":true,
          "name": "JavaSE-1.8",
          "path": "C:\\Program Files\\AdoptOpenJDK\\jdk-8.0.262.10-openj9",
        },
    ],

3.Language Supprt for java I don't know why, but if I don't lower the version of this extension, I get an error. If you want to support intelisense (code completion function), it is ver0.57 or higher, so I lowered it to that level.

Error cause

One of the causes is an error due to a problem with the compatibility between JDK11 API (awt / swing) and windows. To improve this, wait until the jdk update in September 2020, or use an older version such as jdk8, but the second factor is that the VScode specification requires JDK11.

VScode is eclipse compliant, and eclipse seems to recommend the latest jdk, but VScode seems to demand that kind of thing more strongly. So, if the jdk specified on the VScode side is different from the recommended version, it seems to be a specification that causes a runtime error. To avoid this, you specify the execution configuration of java. I don't know the reason for lowering the version of VScode extension (LanguageSupportForJava), but maybe it means that the corresponding jdk is different for each version.

Recommended Posts

Programming memorandum from 51 years old (currently 52) java.awt javax.swing in VScode // Java 11 or more recent is required to run
Programming from 51 years old (currently 52) memorandum VScode javadoc
Programming from 51 years old memorandum android Timer
(Currently 52) programming from 51 years old Note 3 lines Move focus to android button
Programming from 51 years old (currently 52) Note: Add jar with VScode Class.forName java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Drive
Programming from 51 years old (currently 52) Note Path and File
Programming memorandum process thread from 51 years old Handler -reference
Programming from 51 years old Note: Show multiple views in android dialog / with or without xml
Programming memorandum from 51 years old Notification IntentService Service code memorandum / summary
Programming from 51 years old Make FusedLocationProviderClient resident in Foreground Service
Programming from 51 years old Memorandum code for network communication Socket | HttpURLConnection