This post is about my experience in setting up a JSDT development environment. (see also wiki.eclipse.org/JSDT/Development)
Setting up JSDT
There are several ways to setup JSDT development environment. A good one is having an Eclipse Installation for development (IDE) and an Eclipse Installation as Target Platform (TP) .
- IDE : PDE, GIT, XML and all tools for development
- TP : all WebTools Platform plugins, needed to run JSDT
In this post I show a simple setup using eclipse-rcp-mars-1 as IDE and eclipse-jee-mars-1 as TP.
We start downloading Eclipse IDE and Target Platform. In our case
Then we unpack the two installations on two different folders on the system. We don’t need to run the TP Eclipse, but we need to take note of its location.
Launch the IDE, set the target platform and the api baseline then launch the product based on the Target Platform
Set Target Platform
open preferences via menu : Window > Preferences,; select Target Platform and add the location of the TP Instance.
Then add a new Target, via Directory (add Directory in the local filesystem).
Select the base folder of the Target Platform installation, and complete the procedure.
At the end, you will see the target is available
Set Api Baseline
Add an API Baseline based on the TP
Launch the Target Platform from IDE
Create a new launch configuration, based on plugins contained in the target platform,.
Then Run the launch configuration. You will see a new Inner Eclipse popping up. This is the Eclipse instance you’re going to develop against.
Get the JSDT sources
To start working on JSDT you will need the three below projects from the https://git.eclipse.org/r/p/jsdt/webtools.jsdt git repository.
Plus, you might need to import an extra project from the https://git.eclipse.org/r/p/platform/eclipse.platform.runtime git repository.
After cloning and importing the needed projects, the workspace is as simple as you can see below
Here you find the project set to start with JSDT development: jsdtSimpleProjectSet.psf .
You can import the project set via menu: File > Import, then select Git > Projects from Git.
Fix Source Issues
To work on the source code you need some tweaks. As example, you need to set the API Baseline, and you might need to add additional Java JDKs, and additional projects.
As example, if you see an error like the one in the image below, you will need to get the source code for the org.eclipse.core.expressions project (as described above).
Launching the TP with your source Code onboard
Ok, cool. You fixed an Eclipse bug, or you just edited the JSDT source code; and now you want to see the edit “at work”!
This is simple: assuming your edit is contained in the plugins you have in the workspace, you just need to edit the launch configuration; make sure your Workspace plugins are included in the launch configuration, and the correspondant “original” plugins are not selected among the target platform bundles.
Now Run the launch configuration, and you’ll see your application running / so you can test your change.