I am running a simple pattern matcher program exactly as in test_harness
Information:java: Errors occurred while compiling module 'demo_java8'
Information:javac 1.8.0_121 was used to compile java sources
Information:2018-02-06 10:15 - Compilation completed with 1 error and 0 warnings in 376ms
Error:java: Compilation failed: internal java compiler error
However terminal command javac xxx.java
and java xxx
run properly.
Running the first hello world program gives the same error.
Invalidate Caches/Restart. Delete user config. Create a new project (trying to see if my current project files somehow all got messed up, but the problems persist even with new projects) Uninstall + Reinstall.
Press Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment| Compiler.
IntelliJ IDEA comes bundled with the Eclipse compiler. Groovy-Eclipse.
In "Settings" --> Build, Execution, Deployment --> "Compiler" check the checkbox "Build project automatically". This will immediately show any compile errors in the project tree.
In my case, the issue is resolved by adding a type parameter object to a class instance that needed it. In the following code replaced new ParameterizedTypeReference<>
with new ParameterizedTypeReference<Map<String, Object>>
return getRestTemplate().exchange(uri,
HttpMethod.POST,
new HttpEntity<>(headers),
new ParameterizedTypeReference<Map<String, Object>>() {
});
It turned out that "odd" error description is because of maven plugin was missing. And it's default was 1.5 while Console
class is only available since 1.6. Instead of jar or class cannot be found
, it gives a blur description internal java compiler error
. Information:javac 1.8.0_121 was used to compile java sources
was a hint that the javac version and sdk version mismatch. Besides, I was surprised that intellij idea run function uses maven build
(I thought it was just for cli) .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With