Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JDT without Eclipse?

Some time ago I wrote an Eclipse plugin which makes use of JDT to do some parsing. Now I am thinking of making a command-line version of this app. Naturally, I hope to reuse the parsing code, so I need to get JDT to work outside Eclipse. Is there any way I can accomplish this (maybe build some wrappers, etc)? Are there any ports of the JDT library that provide the same API / functionality but work independently of Eclipse?

Any help will be greatly appreciated. Thanks.

like image 745
alexloh Avatar asked Jan 21 '10 23:01

alexloh


People also ask

Is JDT part of Eclipse?

JDT/Core is the Java infrastructure of the Java IDE. It includes: An incremental Java compiler. Implemented as an Eclipse builder, it is based on technology evolved from VisualAge for Java compiler.

What is Java JDT?

The JDT project provides the tool plug-ins that implement a Java IDE supporting the development of any Java application, including Eclipse plug-ins.

What is Eclipse JDT core compiler?

org.eclipse.jdt.core. The Java model is the set of classes that model the objects associated with creating, editing, and building a Java program. org.eclipse.jdt.core.compiler. This package contains compiler associated infrastructure APIs.


3 Answers

You can use JDT Core in the command line. Parsing, AST, rewriting everything can be done without the UI.

like image 163
Prakash G. R. Avatar answered Nov 07 '22 07:11

Prakash G. R.


The JDT is divided into two distinct parts. The parsing parts should all be in plugins which have no UI-dependencies at all. I think they do have a dependency on the Eclipse runtime, which means that you more or less need to create a "headless RCP application".

like image 40
JesperE Avatar answered Nov 07 '22 05:11

JesperE


In order to be able to use AST classes in a stand alone application you have to use such libraries (where xx stands for version):

org.eclipse.core.contenttype_xx.jar
org.eclipse.core.jobs_xx.jar
org.eclipse.core.resources_xx.jar
org.eclipse.core.runtime_xx.jar
org.eclipse.equinox.common_xx.jar
org.eclipse.equinox.preferences_xx.jar
org.eclipse.jdt.core_xx.jar
org.eclipse.osgi_xx.jar

If you installed eclipse with JDT all those jars are in eclipse's plugin folder for example in Windows it could be in C:\Program Files\eclipse\plugins\

like image 23
Templar Avatar answered Nov 07 '22 07:11

Templar