Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Building eclipse JDT core (I want to know the easiest way to build org.eclipse.jdt.core and locally generate a jar file to use in my project. )
Building eclipse JDT core [message #1831217] Fri, 14 August 2020 01:16 Go to next message
Malinda Dilhara is currently offline Malinda DilharaFriend
Messages: 5
Registered: August 2020
Junior Member
Hello everyone.

I would be really grateful to you if you could help me to figure out below question. I believe it is a fundamental question for you.

I am using ASTNode from org.eclipse.jdt.core. I want to do a small change on that class, compile the project org.eclipse.jdt.core agin, and then use the generated jar file as a dependency of my project.


As the first step, I read couple of random documents on internet and started the process with
cloning git repository and tried to complete using maven. It gives me so many errors. To be honest the project pom file itself gives errors.

Can any body help me to identify the easiest way to fulfill my requirement? Am I in the right path? Is there a guided document?

Thanks in advance.
Re: Building eclipse JDT core [message #1831259 is a reply to message #1831217] Sat, 15 August 2020 18:08 Go to previous messageGo to next message
Malinda Dilhara is currently offline Malinda DilharaFriend
Messages: 5
Registered: August 2020
Junior Member
Could you please help me to find a correct guide to build JDT Core. I believe that I am asking this question in the right place.

Thank you!
Re: Building eclipse JDT core [message #1831267 is a reply to message #1831259] Sun, 16 August 2020 06:19 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31546
Registered: July 2009
Senior Member
Did you find this document:

https://wiki.eclipse.org/JDT_UI/How_to_Contribute

There are these general instructions for how to create a development environment for all of the Eclipse Platform SDK, including JDT:

https://wiki.eclipse.org/Eclipse_Platform_SDK_Provisioning

When you get to the section "Review the Variables" you can hit the back button on the wizard first and deselect any projects you don't needed, i.e., select only the JDT projects.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Building eclipse JDT core [message #1831271 is a reply to message #1831267] Sun, 16 August 2020 06:39 Go to previous messageGo to next message
Manoj Palat is currently offline Manoj PalatFriend
Messages: 10
Registered: October 2014
Junior Member
Since ASTNode comes in JDT.Core, you may want to take a look at https://wiki.eclipse.org/JDT_Core_Committer_FAQ as well.

Manoj N Palat
Eclipse Java Development Tools (JDT).
Re: Building eclipse JDT core [message #1831278 is a reply to message #1831271] Sun, 16 August 2020 09:36 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6874
Registered: July 2009
Senior Member
Hi

If you only want to make a change for brief debugging / experimenting purposes, you may find that the old fashioned way of File->Import->Plugin Development->Plugins and Fragments for the relevant plugin with its sources works. In principle this just loads everything you need from what you already have; no need to find the correct GIT repos and magic builds.

If you think you want to improve JDT, think again; everything you change will be a maintenance burden, even if you can successfully contrive to make your changes by inheritance.

Unless of course you have the enthusiasm to become a JDT expert and contribute to its future ... welcome.

Regards

Ed Willink
Re: Building eclipse JDT core [message #1831290 is a reply to message #1831278] Sun, 16 August 2020 19:43 Go to previous messageGo to next message
Malinda Dilhara is currently offline Malinda DilharaFriend
Messages: 5
Registered: August 2020
Junior Member
Thanks everyone for your opinions.
Following the guidances, I could successfully build the core JDT for Java 11. Now I am struggling with following error.
I added the locally built JAR to my project and successfully compiled my project in maven (I had to use Java 11). However, when I try to run my program, I received following runtime error. I changed the project JDK version to 11 and reinstalled all the dependencies. But it did not resolve the below runt time error.

Exception in thread "pool-2-thread-1" java.lang.NoSuchMethodError: org.eclipse.core.runtime.SubMonitor.split(I)Lorg/eclipse/core/runtime/SubMonitor;
	at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:820)
	at utils.JavaASTUtil.parseSource(JavaASTUtil.java:87)
	at change.CFile.<init>(CFile.java:32)
	at change.RevisionAnalyzer.buildGitModifiedFiles(RevisionAnalyzer.java:310)
	at change.RevisionAnalyzer.analyzeGit(RevisionAnalyzer.java:130)
	at change.ChangeAnalyzer.analyzeGit(ChangeAnalyzer.java:243)
	at change.ChangeAnalyzer.analyzeGit(ChangeAnalyzer.java:228)
	at main.MainChangeAnalyzer$2.run(MainChangeAnalyzer.java:99)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)


Do you have any idea on this? Below is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>AtomicASTChangeMining</groupId>
   <artifactId>AtomicASTChangeMining</artifactId>
   <version>0.0.1-SNAPSHOT</version>
   <repositories>
      <repository>
         <id>local-maven-repo</id>
         <url>file:///Users/xx/Documents/Research_Topic_2/</url>
      </repository>
   </repositories>
   <properties>
      <maven.compiler.source>11</maven.compiler.source>
      <maven.compiler.target>11</maven.compiler.target>
   </properties>
   <build>
      <sourceDirectory>src</sourceDirectory>
      <plugins>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
               <source>11</source>
               <target>11</target>
            </configuration>
         </plugin>
      </plugins>
   </build>
   <dependencies>
      <dependency>
         <groupId>org.eclipse.core</groupId>
         <artifactId>runtime</artifactId>
         <version>3.10.0-v20140318-2214</version>
      </dependency>
      <dependency>
         <groupId>org.eclipse.birt.runtime</groupId>
         <artifactId>org.eclipse.core.resources</artifactId>
         <version>3.10.0.v20150423-0755</version>
      </dependency>
      <!-- local repo -->
      <dependency>
         <groupId>org.eclipse.jdt</groupId>
         <artifactId>org.eclipse.jdt.core</artifactId>
         <version>3.23.0-SNAPSHOT</version>
      </dependency>
      <dependency>
         <groupId>org.eclipse</groupId>
         <artifactId>osgi</artifactId>
         <version>3.10.0-v20140606-1445</version>
      </dependency>
   </dependencies>
</project>

Re: Building eclipse JDT core [message #1831305 is a reply to message #1831290] Mon, 17 August 2020 07:46 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6874
Registered: July 2009
Senior Member
Hi

First. Don't use Maven until you have got JDT to build 'interactively' for you in Eclipse. Long standing Eclipse projects predate Maven and use the Eclipse builders so that most things happen automatically by auto-build. It should just all work, and provide a reference against which you can compare a Maven equivalent.

Second, use a consistent tool suite. BIRT is dead and is certainly not a prerequisite of JDT. BIRT runtime is a relic that supports some dubious legacy functionality in some tools such as MoDisco. OSGI from 2014 looks to be a guaranteed conflict with Java 11. If you really want to build a 2015 vintage JDT you should probably go back to Java 8 or even Java 6. But I presume you want a current JDT so everything should be current, though you might temporarily fix on 2020-06 and Java 8 to avoid extra confusion from the current migration beyond Java 8.

Regards

Ed Willink
Previous Topic:java.lang.NoSuchMethodError in JDT Core runtime
Next Topic:Continuing eclipse problem
Goto Forum:
  


Current Time: Sat Oct 24 18:11:45 GMT 2020

Powered by FUDForum. Page generated in 0.02171 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top