Build IntelliJ IDEA Community Edition branch 191.6707 FAILED

I build IntelliJ IDEA Community Edition for branch 191.6707. I try to build on jdk-8u171-windows-x64,jdk-8u191-windows-x64,jdk-8u202-windows-x64 on windows and openjdk8 on linux, the console both prints fellow exception.

class org.jetbrains.jps.javac.ast.InProcessRefCollectorCompilerToolExtension : com.sun.tools.javac.api.JavacTaskImpl cannot be cast to com.sun.source.util.JavacTask

But it builds distributions successfully.

[java] Compiling (1%): module 'intellij.platform.extensions' tests
[java] class org.jetbrains.jps.javac.ast.InProcessRefCollectorCompilerToolExtension : com.sun.tools.javac.api.JavacTaskImpl cannot be cast to com.sun.source.util.JavacTask
[java] [gant] java.lang.ClassCastException: com.sun.tools.javac.api.JavacTaskImpl cannot be cast to com.sun.source.util.JavacTask
[java] [gant] at org.jetbrains.jps.javac.ast.JavacReferenceCollectorListener.installOn(JavacReferenceCollectorListener.java:49)
[java] [gant] at org.jetbrains.jps.javac.ast.JavacReferenceCollector.installOn(JavacReferenceCollector.java:31)
[java] [gant] at org.jetbrains.jps.javac.ast.AbstractRefCollectorCompilerToolExtension.beforeCompileTaskExecution(AbstractRefCollectorCompilerToolExtension.java:35)
[java] [gant] at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:176)
[java] [gant] at org.jetbrains.jps.incremental.java.JavaBuilder.compileJava(JavaBuilder.java:458)
[java] [gant] at org.jetbrains.jps.incremental.java.JavaBuilder.compile(JavaBuilder.java:328)
[java] [gant] at org.jetbrains.jps.incremental.java.JavaBuilder.doBuild(JavaBuilder.java:253)
[java] [gant] at org.jetbrains.jps.incremental.java.JavaBuilder.build(JavaBuilder.java:211)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1328)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:1008)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1075)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:969)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:798)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:380)
[java] [gant] at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
[java] [gant] at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139)
[java] [gant] at org.jetbrains.jps.build.Standalone.runBuild(Standalone.java:210)
[java] [gant] at org.jetbrains.intellij.build.impl.JpsCompilationRunner$_runBuild_closure7.doCall(JpsCompilationRunner.groovy:202)
[java] [gant] at org.jetbrains.intellij.build.impl.JpsCompilationRunner$_runBuild_closure7.call(JpsCompilationRunner.groovy)
[java] [gant] at org.jetbrains.intellij.build.impl.logging.BuildMessagesImpl.block(BuildMessagesImpl.groovy:139)
[java] [gant] at org.jetbrains.intellij.build.impl.JpsCompilationRunner.runBuild(JpsCompilationRunner.groovy:199)
[java] [gant] at org.jetbrains.intellij.build.impl.JpsCompilationRunner.buildModuleTests(JpsCompilationRunner.groovy:100)
[java] [gant] at org.jetbrains.intellij.build.impl.CompilationTasksImpl.compileModules(CompilationTasksImpl.groovy:73)
  • [java] [gant] at org.jetbrains.intellij.build.impl.CompilationTasksImpl$compileModules.call(Unknown Source)
12 comments
Comment actions Permalink

Hi, which version of IntelliJ IDEA do you use? Did you modify IDEA properties?

1
Comment actions Permalink

I build and run successfully in intellij idea. But fail to build by ant.

1
Comment actions Permalink

please try a patch:

 

Index: build.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- build.xml (revision 45934412e2ba81d9d9753a339010694f56f7c4e3)
+++ build.xml (date 1557757594675)
@@ -30,7 +30,8 @@
<attribute name="script" />
<attribute name="target" default="default"/>
<sequential>
- <java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">
+ <java failonerror="true" classpath="${project.home}/lib/ant/lib/ant-launcher.jar:${java.home}/lib/tools.jar:${java.home}/../lib/tools.jar" classname="org.apache.tools.ant.launch.Launcher" fork="true">
+<!-- <java failonerror="true" classpath="${project.home}/lib/ant/lib/ant-launcher.jar" classname="org.apache.tools.ant.launch.Launcher" fork="true">-->
<jvmarg line="-Xmx912m"/>
<sysproperty key="jna.nosys" value="true" />
<sysproperty key="java.awt.headless" value="true"/>

1
Comment actions Permalink

Please use workaround -Dcompiler.ref.index=false in idea.properties, will ask responsible developer to investigate.

0
Comment actions Permalink

I build and run successfully in intellij idea. But fail to build by ant.

0
Comment actions Permalink

Ok, thanks, did you modify IDEA sources? Or did you add tools.jar as a library for IDEA Community sources?

0
Comment actions Permalink

I do not modify IDEA sources.  I just add tools.jar to to the Classpath tab for the 1.8 JDK and IDEA JDK in IntelliJ IDEA. Is it necessary to add tools.jar for ant build?  How to do this? I run ant to build version 183.4886 without adding tools.jar successfully.

0
Comment actions Permalink

No, you shouldn't do it. So, in this case I've an another question: does IDEA jdk and 1.8 jdk point to the same jdk?

0
Comment actions Permalink

Thanks, now I'm able to reproduce the problem. Investigating.

0
Comment actions Permalink

The problem was fixed in 'master' branch, see IDEA-206314. (BTW you can easily search for an error message in YouTrack.)

The error message seems to be harmless, but I'll backport the fix to 191 branch to avoid confusion.

0
Comment actions Permalink

Hi Dmitry:

Thank you for your patch,it works fine.

 

0
Comment actions Permalink

Hi Nikolay,

Thank you , I will try 192.* branch again

0

Please sign in to leave a comment.