When I compile a Java project using IntelliJ IDEA, it gives me the following output (and error):
Information:Eclipse compiler 4.6.2 was used to compile java
In JIdea 2020.1.2 and above,
This is may be the language-level set in Project Structure is not compatible with the target byte-code version.
You have to change the target bytecode version .
NOTE : How to check the language-level
In my case, it was response type in restTemplate
:
ResponseEntity<Map<String, Integer>> response = restTemplate.exchange(
eurl,
HttpMethod.POST,
requestEntity,
new ParameterizedTypeReference<>() { <---- this causes error
}
);
Should be like this:
ParameterizedTypeReference<Map<String, Integer>> responseType = new ParameterizedTypeReference<>() {};
ResponseEntity<Map<String, Integer>> response = restTemplate.exchange(
url,
HttpMethod.POST,
requestEntity,
responseType
);
I had the same problem. I fixed changing my settings. Target bytecode version for equals Project bytecode version.
You have to disabled the Javac Options: Use compiler from module target JDK when possible.
In my case it was because of lombok
library with intellij 2019.2 & java11.
According to this IDEA bug after workaround idea works again:
Disable all building from intelliJ and dedicate the build to Maven.