Can I execute Eclipse Java development tools as a standalone process? I need to get Java program's AST structure using Eclipse JDT from another program, and to do that, I need to execute eclipse plugin as a stand-alone process behind the scene.
Is that possible? If so, how one can do that?
Eclipse/jdt and eclipse/ast is nothing more than a jar file, so one can use them to build standalone java application.
I googled to find ASTExplorer as an example to make eclipse/ast plugin as a standalone java project.
The program was targeted for pretty old eclipse (3.0.2), I downloaded the 3.0.2 for Mac OS X this site - http://archive.eclipse.org/eclipse/downloads/drops/R-3.0.2-200503110845/
When the setup is correct, eclipse starts building the project. You can use Project -> Build Project menu. Then, you can check the application works fine in eclipse.
Just executing java -jar ast.jar
doesn't work on Mac, I got a hint from this post.
Running SWT based, cross-platform jar properly on a Mac
In short, you need to run java -XstartOnFirstThread -jar ast.jar