Building troubles and dependency hell. What I'm doing wrong?

As I asked here, I need a way to make my own ui-designer. I'm trying to make it run, but there is a lot of problems with plugins that depends on something. In my case I need ui-designer-core plugin, which needs compiler-impl, compiler-api, idea-ui, openapi and so on… Plus we have libraries. Dozens of libraryes, named somehow different from their file names.
So, I desided to inject my plugin in clean IDEA sources, fetched from official repository. I tryed to build it within IDEA, using new IDEA JDK, and… It fails. Nothing compiles, and I have 100+ errors.
Good, I'v builded IDEA with ant, unzip syapshot, add it as new IDEA JDK, and faced another trouble.

In java/java-impl/src/com/intellij/psi/codeStyle/arrangement/JavaRearranger.java I neded to remove * import.

-import com.intellij.psi.codeStyle.arrangement.std.*;

And replace it with direct imports.
In java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java I neded to do some thing with:

+import com.intellij.psi.codeStyle.ReferenceAdjuster;
import com.intellij.psi.*;

It looks like compiler cannot find correct ReferenceAdjuster, throught * import. But IDEA navigator could.

So, after all this hell I managed build IDEA CE inside IDEA. It has 24 cyclic dependencyes in modules, but it builds.


After long time waiting It starts… and fails. With no message to console, only  single Error box with such text:

Internal exception, please report to http://youtrack.jetbrains.com
java.lang.NoClassDefFoundError: java/lang/ReflectiveOperationException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at com.intellij.ide.Bootstrap.main(Bootstrap.java:41)
    at com.intellij.ide.Bootstrap.main(Bootstrap.java:34)
    at com.intellij.idea.Main.main(Main.java:72)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.ClassNotFoundException: java.lang.ReflectiveOperationException
    at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:101)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at com.intellij.util.lang.UrlClassLoader.loadClass(UrlClassLoader.java:115)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 10 more


Obviously this problem is related to SDK from snapshot. But I can't understand how to solve it.

Sorry, for such unstructured post. I'm shocked by this trobles from nothing. Maybe there is some way to make things simplier?
What the hell is going on, why can't I clone repository and build IDE in IDEA just as I do in ant? I can't belive, that there is so much effort, to make so ordinary thing. Probably, I'm missing something important?

I use Mac OS X 10.8.4 and JDK 1.6.0_51.
2 comments

If you're building IntelliJ IDEA sources, you need to use a regular Java SDK as the JDK for your project, not an IntelliJ IDEA SDK. Looks like that's what's causing most of your problems.

(Of course, the HEAD of the Community Edition source tree is almost always buildable without any modifications, and if it's not at some particular moment, we fix this ASAP.)

0

Oh, my apologies! I was wrong and too sharp. Sorry.
Yes, this is my mistake. All was right now.Thank you!

0

Please sign in to leave a comment.