Closed robertmarkbram closed 4 years ago
This is because you still use Java 8 and with the latest release of the extension JDK 11 is required. Let's go away from very old stuff ... there is really no reason to stay on Java 8
Fair enough. This should be documented in the project page so people know there is requirement on a specific minimum version of Java.
btw if you need java 8 for your project you can change the java.home as follows:
"java.home": "jdk-8-path" to "java.home": "jdk-11-path"
and keep the rest of the settings as it is and you should be able to build your project with JDK 11 but Java 8 compatibility.
...I mean in the workspace settings on Visual Studio Code
I already have that in my settings.json
have that and am still seeing the error.
"java.home": "C:\\Program Files\\Java\\jdk-14.0.1",
ah, no it's not possible - you need java 11 and above compatibility because I changed some parts of the extension to java 11 syntax... maybe I was too fast in switching java version (I'm working since ~2 years with java 11 syntax and personally I do not want to miss it anymore). However, I will investigate what I can do ...
This is because you still use Java 11 and the latest Java is JDK 14. Let's go away from very old stuff ... there is really no reason to stay on Java 11.
:)
...hm, Java 11 is a LTS version - so let's not run too fast ;-)
Somehow this is still a JDK 8 issue though (I do have JDK 8, 11 and 14 installed).
I changed my settings.json to
"java.home": "C:\\Program Files\\Java\\jdk-11.0.8",
But I still get the same error, which is definitely saying "I want JDK 11 but you used JDK 8":
Exception in thread "main" com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting constructor, java.lang.UnsupportedClassVersionError: io/github/jhipster/jdl/ide/JDLIdeSetup has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Something needs to be recompiled?
ok, that's strange I will investigate
can you attach your settings.json?
Here you are, from C:\Users\Robert Bram\AppData\Roaming\Code\User\settings.json
:
can you paste the output of java -version
here?
That's not good. When I open a terminal within VS Code I get:
$ java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
that's exactly the reason why it's not working
That sucks. It's not using the JDK version I set in VS Code.
as I said I will have a look on how to improve/check this but in the meantime set jdk 11 as default and it will work.
fixed
Describe the bug
UnsupportedClassVersionError
after installing the plugin.To Reproduce Steps to reproduce the behavior:
See error
Full stack trace: jhipster-vscode-plugin-error.txt
Expected behavior
No error.
Desktop (please complete the following information):