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/ 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/ 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
java.lang.NoClassDefFoundError: java/lang/ReflectiveOperationException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at com.intellij.ide.Bootstrap.main(
    at com.intellij.ide.Bootstrap.main(
    at com.intellij.idea.Main.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.intellij.rt.execution.application.AppMain.main(
Caused by: java.lang.ClassNotFoundException: java.lang.ReflectiveOperationException
    at com.intellij.util.lang.UrlClassLoader.findClass(
    at java.lang.ClassLoader.loadClass(
    at com.intellij.util.lang.UrlClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    ... 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.
Comment actions Permalink

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.)

Comment actions Permalink

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


Please sign in to leave a comment.