How to get JDT eclipse sources?

I am trying to write an Eclipse plugin, but found that there is no source by default. I searched on www.eclipse.org but found nothing.

My eclipse is 3.6.2. Where can I get a JDT source?

+6
source share
5 answers

Assuming you just want to see the JDT source code (as opposed to editing it), the easiest way is to install the source plugins. Go to the following Helios update site:

http://download.eclipse.org/releases/helios/

Then find the entry labeled JDT Source or similar. It can also be called the JDT SDK, which will mean that it has a source plus some plugin developer docs.

+2
source

It seems that in recent versions of Eclipse (at least Juno and Kepler), the source is no longer included in the JDT package that ships with Eclipse. You have to go and download p2 source repo manually:

  • go to http://download.eclipse.org/eclipse/downloads/
  • select release (e.g. 4.2 or 4.3M6)
  • scroll down to the "JDT SDK" and download the p2 repository
  • from Eclipse, add the repository (enter "archive")
  • Remember to uncheck the "Group positions by category" box because this repository does not have a category, which makes Eclipse nothing by default (which can be quite perplexing).
  • check the box next to "Eclipse JDT Plug-in Developer Resources", "Next>," Next "> Accept License," Finish.

Wait for the installation to complete, restart Eclipse, enjoy!

+18
source
+2
source

As others have pointed out, the JDT source is no longer included in the JDT package. It is also not available on the main update site (currently Mars: http://download.eclipse.org/releases/mars ).

However, it is available from the Eclipse Project Updates site, which should already be on your list of available software sites:

http://download.eclipse.org/eclipse/updates/4.5

Open the Eclipse Java Development Tools section and select the Eclipse JDT Plug-in Developer Resources. Much easier than downloading the P2 repository manually and always up to date!

+2
source

Starting with Janurary 2017, JDT banks are also published on the maven central server ( announcement ). See artifacts with groupId org.eclipse.jdt .

Example. For:

 <dependency> <groupId>org.eclipse.jdt</groupId> <artifactId>org.eclipse.jdt.ui</artifactId> <version>3.13.51</version> </dependency> 

The source tank is in the expected location:

 http://repo1.maven.org/maven2/org/eclipse/jdt/org.eclipse.jdt.ui/3.13.51/org.eclipse.jdt.ui-3.13.51-sources.jar 

(of course, it’s better to use tools like maven to find and load the source banks)

0
source

Source: https://habr.com/ru/post/891649/


All Articles