Javac2 ant task documentation, or help?

I've started usign IDEA 4.0's UI Designer, and find it helpful. However, like many people, I prefer to have my build process separate from my IDE. I've found a few pre-4.0-release postings discussing the '' Ant task that is supposed to be a drop-in replacement for '' in order to handle the UI Designer's .form XML files, which seems like a perfect fit. However, I can't find any documentation, or get it working. I initially tried just including $IDEA_HOME/redist/javac2.jar in my compilation classpath, which gave me the following error: $ ant compile Buildfile: build.xml prepare: compile: BUILD FAILED java.lang.NoClassDefFoundError at com.intellij.util.BcelUtils$1.class$(Unknown Source) at com.intellij.util.BcelUtils.disposeBcel(Unknown Source) at com.intellij.uiDesigner.ant.Javac2.compile(Unknown Source) at ... at Caused by: java.lang.ClassNotFoundException: org.apache.bcel.util.SyntheticRepository at at at at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClassInternal( at java.lang.Class.forName0(Native Method) at java.lang.Class.forName( ... 12 more So, following someone else's forum post, I started including other jarfiles as well (bcel.jar, idea.jar, etc etc). I quickly tired of the guess & check, and just included every jarfile from the IDEA 4.0 release into the classpath. Crude, I know, but what the heck. That produces a RuntimeException, as shown here: $ ant compile Buildfile: build.xml prepare: compile: BUILD FAILED java.lang.RuntimeException: java.lang.NoSuchFieldException: _repository at com.intellij.util.BcelUtils.disposeBcel( at com.intellij.uiDesigner.ant.Javac2.compile( at at ... at Caused by: java.lang.NoSuchFieldException: _repository at java.lang.Class.getDeclaredField( at com.intellij.util.BcelUtils.disposeBcel( ... 10 more Total time: 7 seconds ]]>

My environment:
o Mac OS X 10.3
o java version "1.4.2_03"
o IDEA 4.0

From the prior postings, this task appears to work without much effort for other folks -- is there a quirk with the Mac OS JDK? Or am I doing something incredibly stupid? Will this task be openly documented in a future release?

Many thanks, & keep up the great work,


1 comment

Javac2 accepts the same parameters as ordinary javac? but also compiles IDEA form files/ In order for it to work you should have
bcel.jar and jdom.jar libraries form IDEA distribution in ant's classpath.

Best regards,
Eugene Zhuravlev
Software Developer
JetBrains Inc.
"Develop with pleasure!"


Please sign in to leave a comment.