Cannot build IDEA sources

After downloading idea sources I'm trying to build idea with 'ant build' command. Build finally fails with message:

[java] ##teamcity[progressMessage 'Compiling 33 groovy files']

[java]     [mkdir] Created dir: C:\own\jetbrains\idea\out\classes\__build_temp__\groovyc_commandline_jps

[java]      [java] >>> a serious error occurred: com/sun/tools/javac/util/DefaultFileManager

[java]      [java] >>> stacktrace:

[java]      [java] java.lang.NoClassDefFoundError: com/sun/tools/javac/util/DefaultFileManager

[java]      [java]         at java.lang.ClassLoader.defineClass1(Native Method)

[java]      [java]         at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)

[java]      [java]         at java.lang.ClassLoader.defineClass(ClassLoader.java:615)

[java]      [java]         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)

[java]      [java]         at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)

[java]      [java]         at java.net.URLClassLoader.access$000(URLClassLoader.java:58)

[java]      [java]         at java.net.URLClassLoader$1.run(URLClassLoader.java:197)

[java]      [java]         at java.security.AccessController.doPrivileged(Native Method)

[java]      [java]         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

[java]      [java]         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

[java]      [java]         at java.lang.ClassLoader.loadClass(ClassLoader.java:295)

[java]      [java]         at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:676)

[java]      [java]         at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:544)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:683)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:272)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolveFromModule(ResolveVisitor.java:628)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:272)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:240)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:224)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:236)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.visitField(ResolveVisitor.java:180)

[java]      [java]         at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1031)

[java]      [java]         at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1248)

[java]      [java]         at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148)

[java]      [java]         at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:574)

[java]      [java]         at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:813)

[java]      [java]         at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:511)

[java]      [java]         at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:487)

[java]      [java]         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:464)

[java]      [java]         at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:448)

[java]      [java]         at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:57)

[java]      [java]         at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:170)

[java]      [java]         at org.codehaus.groovy.tools.FileSystemCompiler.commandLineCompile(FileSystemCompiler.java:138)

[java]      [java]         at org.codehaus.groovy.tools.FileSystemCompiler.main(FileSystemCompiler.java:152)

[java]      [java]         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[java]      [java]         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

[java]      [java]         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

[java]      [java]         at java.lang.reflect.Method.invoke(Method.java:597)

[java]      [java]         at org.jetbrains.jps.ProgramRunner.main(ProgramRunner.java:29)

[java]      [java] Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.util.DefaultFileManager

[java]      [java]         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

[java]      [java]         at java.security.AccessController.doPrivileged(Native Method)

[java]      [java]         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

[java]      [java]         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

[java]      [java]         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

[java]      [java]         ... 40 more

[java]

[java] BUILD FAILED

[java] C:\own\jetbrains\idea\build\gant.xml:17: : Java returned: 1



Why build fails and how can i fix it?

When building from IDEA - everything is ok (I've added tools.jar to idea sdk)

Thanks.
5 comments
Comment actions Permalink

Hi Anton,

Please add 'tools.jar' from $JDK_HOME/lib to the classpath of your project jdk. It contains jvm api necessary for debugging.

Denis

0
Comment actions Permalink

Hi Denis!

I have tools.jar in jdk classpath if you mean classpath in IDEA:
http://screencast.com/t/dDdfEzqa

Or did you mean some other place?

I also have added tools.jar in system variable CLASSPATH:

C:\own\jetbrains\idea>echo %CLASSPATH%
C:\Program Files\Java\jdk1.6.0_27\lib\tools.jar



The error is still there. I have the exception only when build with ant. When I make the project from within IDEA - everything is fine.

Thanks!
0
Comment actions Permalink

Hi Anton,

Sorry, haven't noticed that you mention exactly ant build. Let me check that at the local environment.

Denis

0
Comment actions Permalink

Hi Anton,

Just tried to perform ant build against community edition sources retrieved from github - everything is ok. Can you confirm that you still have the problem?

Denis

0
Comment actions Permalink

Everything is fine now, thanks.

0

Please sign in to leave a comment.