views:

168

answers:

1

I am not working on an Eclipse plug-in project; however, I use an external library that generates an instance of org.eclipse.jdt.core.dom.CompilationUnit. Is there a way to generate Java bytecode from it?

Some searching revealed that CompilationUnit's are typically built by registering a custom builder for the Eclipse project, then letting eclipse invoke it... but I couldn't find any way to leverage that for a stand-alone application.

+1  A: 

I suggest to have a look at the code in Apache Commons JCI. It implements an eclipse compiler for standalone applications.

tcurdt
I looked and it can convert an ICompilationUnit (which is surprisingly not related to CompilationUnit). However, it does seem like a good tool which takes me in the right direction, so thanks!
Oak