IntelliJ IDEA tells me “Error:java: Compilation failed: internal java compiler error idea”

[]
IntelliJ IDEA tells me “Error:java: Compilation failed: internal java compiler error idea” – Stack Overflow

Sorry, we no longer support your browser

Join Stack Overflow to learn, share knowledge, and build your career.

Asked 4 years, 2 months ago

Viewed 63k times

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 sources Information:Module “sinoWeb” was fully rebuilt due to project configuration/dependencies changes Information:2017/3/23 11:44 – Compilation completed with 1 error and 0 warnings in 5m 32s 949ms Error:java: Compilation failed: internal java compiler error

I’m quite confused confused by this! Below are my settings:

enter image description

enter image description here

asked Mar 23 ’17 at 3:46

ieatczpieatczp

78911 gold badge55 silver badges33 bronze badges

5

  1. On Intellij IDEA Ctrl + Alt + S to open settings.
  2. Build, Execution, Deployment -> Compiler -> Java Compiler
  3. choose your java version from Project bytecode version
  4. Uncheck Use compiler from module target JDK when possible
  5. click apply and ok.

answered Oct 31 ’18 at 10:58

Musab BozkurtMusab Bozkurt

1,18111 gold badge44 silver badges55 bronze badges

3

I solved this issue by increasing the default value(700) of Build process heap size on IntelliJ’s compiler settings.

enter image description here

answered Feb 2 ’18 at 15:17

sezerugsezerug

81677 silver badges1010 bronze badges

0

I changed my compiler to Eclipse and run my project. Afterwards changed back to Javac and problem solved. I don’t know exact problem but it can help who is looking for solution.

intellij java compiler

answered Jul 24 ’17 at 7:41

omerhakanbiliciomerhakanbilici

63611 gold badge1515 silver badges2424 bronze badges

1

In my case, using Java 11, I had:

public List foo() { … return response.readEntity(new GenericType>() {});

and Intellij suggested I should use <> instead of GenericType>, as such:

public List foo() { … return response.readEntity(new GenericType<>() {});

I did that in four functions and the project stopped compiling with an internal compiler error, reverted and it compiled again. Looks like a bug with type inference.

answered Jul 26 ’19 at 7:16

Tony BenBrahimTony BenBrahim

6,24111 gold badge3131 silver badges4545 bronze badges

3

For me the module’s target bytecode version was set to 5. I changed it to 8 and the error is gone:

module's bytecode version setting

answered Apr 17 ’20 at 10:40

velocityvelocity

1,0701313 silver badges2121 bronze badges

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.

enter image description here

answered Sep 16 ’19 at 10:27

FilomatFilomat

49311 gold badge77 silver badges1313 bronze badges

3

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 .

  1. Go to Settings [ Ctrl+Alt+S ]
  2. Select Java Compiler
  3. Select module in the table
  4. Change the byte-code version to map what you selected in the previous step for language-level

enter image description here

NOTE : How to check the language-level

  1. Go to Project Structure [ Ctrl+Alt+Shift+S ]
  2. Select Modules sub section
  3. Select each module
  4. Under sources-section, check Language Level

enter image description here

answered Aug 8 ’20 at 3:04

primeprime

11.2k1111 gold badges7575 silver badges112112 bronze badges

You have to disabled the Javac Options: Use compiler from module target JDK when possible. enter image description here

Maximilian Ast

2,9541212 gold badges3232 silver badges4040 bronze badges

answered Apr 17 ’19 at 14:04

0

Per-module bytecode version settings

I met the same problem

I solved it by changing the Target bytecode error from 1.5 to 8

Brad Mace

26.3k1515 gold badges9494 silver badges141141 bronze badges

answered Jan 9 at 9:49

kl wkl w

5111 silver badge22 bronze badges

Changing the Language Level in the Project Settings (Ctrl + Alt + Shift + S) to Java 8 solved the problem for me

answered Jul 27 ’18 at 7:52

Chris K.Chris K.

99277 silver badges99 bronze badges

In my case, it was response type in restTemplate: enter image description here

ResponseEntity> response = restTemplate.exchange( eurl, HttpMethod.POST, requestEntity, new ParameterizedTypeReference<>() { <---- this causes error } );

Should be like this:

ParameterizedTypeReference> responseType = new ParameterizedTypeReference<>() {}; ResponseEntity> response = restTemplate.exchange( url, HttpMethod.POST, requestEntity, responseType );

answered May 19 ’20 at 9:38

dev_in_progressdev_in_progress

2,12722 gold badges1818 silver badges2929 bronze badges

1

I had the same problem. I fixed changing my settings. Target bytecode version for equals Project bytecode version.

enter image description here

answered Jun 15 ’20 at 21:30

What worked for me is to update the Open JDK version

answered Jun 17 ’20 at 11:26

I got the same error with Community edition 2020.3 on Windows 10 with an older version of the JDK (openjdk version “11” 2018-09-25).

Updating the JDK to javac 11.0.10 fixed the issue.

Here’s the stack trace that showed up with the error when using openjdk version “11” 2018-09-25:

java: compiler message file broken: key=compiler.misc.msg.bug arguments=11, {1}, {2}, {3}, {4}, {5}, {6}, {7} java: java.lang.AssertionError java: at jdk.compiler/com.sun.tools.javac.util.Assert.error(Assert.java:155) java: at jdk.compiler/com.sun.tools.javac.util.Assert.check(Assert.java:46) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$2$1.setOverloadKind(DeferredAttr.java:172) java: at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.visitReference(ArgumentAttr.java:283) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMemberReference.accept(JCTree.java:2190) java: at jdk.compiler/com.sun.tools.javac.comp.ArgumentAttr.attribArg(ArgumentAttr.java:197) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:653) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribArgs(Attr.java:751) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:1997) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1634) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:655) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3573) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2110) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2006) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitReturn(Attr.java:1866) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCReturn.accept(JCTree.java:1546) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:724) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:743) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1294) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1020) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:498) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculative(DeferredAttr.java:481) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr.attribSpeculativeLambda(DeferredAttr.java:456) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredAttrNode$StructuralStuckChecker.canLambdaBodyCompleteNormally(DeferredAttr.java:900) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredAttrNode$StructuralStuckChecker.visitLambda(DeferredAttr.java:878) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCLambda.accept(JCTree.java:1807) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredAttrNode$StructuralStuckChecker.complete(DeferredAttr.java:832) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:335) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredAttrNode.process(DeferredAttr.java:779) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredAttrContext.complete(DeferredAttr.java:626) java: at jdk.compiler/com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:214) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.rawInstantiate(Resolve.java:605) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.selectBest(Resolve.java:1563) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethodInScope(Resolve.java:1733) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1802) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.findMethod(Resolve.java:1776) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve$10.doLookup(Resolve.java:2654) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.lookup(Resolve.java:3293) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3543) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2651) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2645) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:3721) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3601) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2598) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$4.complete(DeferredAttr.java:374) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredType.check(DeferredAttr.java:321) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve$MethodResultInfo.check(Resolve.java:1060) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.checkArg(Resolve.java:887) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve$AbstractMethodCheck.argumentsAcceptable(Resolve.java:775) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve$4.argumentsAcceptable(Resolve.java:896) java: at jdk.compiler/com.sun.tools.javac.comp.Infer.instantiateMethod(Infer.java:181) java: at jdk.compiler/com.sun.tools.javac.comp.Resolve.checkMethod(Resolve.java:644) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.checkMethod(Attr.java:4120) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.checkIdInternal(Attr.java:3913) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.checkMethodIdInternal(Attr.java:3814) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.checkId(Attr.java:3803) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:3696) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitLambda(Attr.java:2595) java: at jdk.compiler/com.sun.tools.javac.comp.DeferredAttr$DeferredAttrNode.process(DeferredAttr.java:811) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:3553) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:2243) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:702) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitExec(Attr.java:1773) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1452) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1098) java: at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:866) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:4683) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4574) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4523) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:4503) java: at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:4448) java: at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1341) java: at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:973) java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0(JavacTaskImpl.java:104) java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(JavacTaskImpl.java:147) java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:100) java: at jdk.compiler/com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:94) java: at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:231) java: at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:501) java: at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:353) java: at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:277) java: at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:231) java: at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1441) java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1100) java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1224) java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:1066) java: at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:832) java: at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:419) java: at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:183) java: at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:132) java: at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:302) java: at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:132) java: at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:219) java: at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) java: at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) java: at java.base/java.lang.Thread.run(Thread.java:834) java: Compilation failed: internal java compiler error java: Errors occurred while compiling module ‘project’ javac 11 was used to compile java sources Finished, saving caches… Compilation failed: errors: 1; warnings: 100

answered Apr 3 at 23:17

Updated Java compiler to correct “Target bytecode version” which in my case is 8 :

enter image description here

answered May 6 at 10:25

blue-skyblue-sky

45.7k124124 gold badges359359 silver badges647647 bronze badges

Your Answer

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Draft saved

Draft discarded

Post as a guest

lang-java

{};’)}catch(a){return!0}}function o(){return’undefined’!=typeof googletag&&!!googletag.apiReady}function p(){o()||(googletag={cmd:l(B)})}function q(){var a=document.createElement(‘div’);a.className=’adsbox’,a.id=’clc-abd’,a.style.position=’absolute’,a.style.pointerEvents=’none’,a.innerHTML=’ ‘,document.body.appendChild(a)}function r(){return Object.keys(F.ids).filter(function(a){return’clc-cpa’!=a})}function s(a){var b=a.split(‘_’)[0],c=F.ids[b],d=F.slots[c];’function’==typeof d&&(d=d(b));return{path:’/’+C+’/’+E+’/’+c+’/’+D,sizes:d,zone:c}}function t(a){try{Array.isArray(clc.dfp.slotsRenderedEvents)||(clc.dfp.slotsRenderedEvents=[]),clc.dfp.slotsRenderedEvents.push(a);var b=a.slot.getSlotElementId(),c=[];b||c.push(‘id=0’);var d=document.getElementById(b);if(!b||d?d.hasAttribute(‘data-clc-stalled’)&&c.push(‘st=1’):c.push(‘el=0’),0!==c.length)return void G(c.join(‘&’));var e=s(b),f=e.zone;if(clc.collapse&&clc.collapse[f]&&a.isEmpty)return h(d),void d.setAttribute(‘data-clc-ready’,’true’);if(-1!==y.dh.indexOf(a.lineItemId))h(d);else if(a.lineItemId){d.setAttribute(‘data-clc-prefilled’,’true’);var j=d.parentElement;if(j.classList.contains(‘js-zone-container’)){g(j);var k=j.querySelectorAll(‘.js-report-ad-button-container’),l=k[0];switch(l.style.height=’24px’,b){case’dfp-tlb’:case’dfp-tag’:{j.classList.add(‘mb8′);break}case’dfp-mlb’:case’dfp-smlb’:case’dfp-bmlb’:{j.classList.add(‘my8′);break}case’dfp-isb’:{j.classList.add(‘mt24′);break}case’dfp-m-aq’:{j.classList.add(‘my12’),j.classList.add(‘mx-auto’);break}default:}i(j),i(d)}else i(d);if(‘dfp-msb’==b){var m=document.getElementById(‘hireme’);h(m)}}d.setAttribute(‘data-clc-ready’,’true’)}catch(a){var n=document.querySelector(‘#dfp-tsb, #dfp-isb, #clc-tsb’);n&&n.setAttribute(‘data-clc-ready’,’true’),G(‘e=1’)}}function u(a,b){‘dfp-isb’===a&&b.setTargeting(‘Sidebar’,[‘Inline’]),’dfp-tsb’===a&&b.setTargeting(‘Sidebar’,[‘Right’]);var c=s(a),d=c.path,e=c.sizes,f=c.zone,g=googletag.defineSlot(d,e,a);g.addService(b),!1;var h=a.split(‘_’);if(‘clc-cpa’==h[0]&&h[1]){var i=h[1];g.setTargeting(‘talent-company-id’,i)}}function v(b){var c=a.dfp&&a.dfp.targeting||{};’SystemDefault’===c.ProductVariant&&(window.matchMedia&&window.matchMedia(‘(prefers-color-scheme: dark)’).matches?c.ProductVariant=’Dark’:c.ProductVariant=’Light’),Object.keys(c).forEach(function(a){b.setTargeting(a,c[a])})}function w(a){var g=a.map(b).filter(e);return{eligible:g.filter(f).filter(d),ineligible:g.filter(c)}}function x(b){void 0===b&&(b=r());var c=[‘dfp-mlb’,’dfp-smlb’];if(!o())return p(),void googletag.cmd.push(function(){return x(b)});var d=w(b),e=d.eligible,f=d.ineligible;if(e.forEach(function(a){g(a)}),f.forEach(h),0!==e.length){y.abd&&q();var i=googletag.pubads().getSlots(),j=i.filter(function(a){return 0c.indexOf(a.id)}),m=e.filter(function(a){return!!y.ll&&0<=c.indexOf(a.id)});l.forEach(function(a){u(a.id,k),a.setAttribute('data-dfp-zone','true')}),googletag.enableServices(),l.forEach(function(a){googletag.display(a.id)}),y.ll&&(k.enableLazyLoad({fetchMarginPercent:0,renderMarginPercent:0}),m.forEach(function(a){u(a.id,k),a.setAttribute('data-clc-prefilled','true')}),m.forEach(function(a){googletag.display(a.id)}))}}var y=function(a){for(var b=[],c=1;c Stack Overflow works best with JavaScript enabled

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

 

Source

Leave a comment

Your email address will not be published. Required fields are marked *