java.lang.NoSuchMethodError in JDT Core runtime [message #1831294] |
Sun, 16 August 2020 20:11  |
Eclipse User |
|
|
|
Hello everyone,
I'm feeling like I've gotten way out of my depth here and need some guidance.
I have a very basic question but due to the lack of experience in eclipse developments, this a very hard to figure out alone.
What I am trying to do
Perform a small modification to `eclipse.jdt.core`, rebuilt, and use the locally built jar in my research project.
What steps I have taken so far
1. Created an eclipse workspace as described in Link
2. Built eclipse.jdt.core using the mvn -P build-individual-bundles package
3. Added the resulting jar file (`org.eclipse.jdt.core-3.23.0-SNAPSHOT.jar`) which is created in the target folder to my project as a maven dependency.
Problem
Even though my project successfully compiled with the modified jar file, it gives me the following run 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)
Additional steps
1. When I use the eclipse.jdt.core library in the maven central repository it works perfectly fine. It suggests that the problem is with the locally built jar.
2. I had to use Java 11 when configuring the eclipse workspace. Therefore, I changed Java version of my project to 11.
Questions
Is there any configuration or any setting that I need to use in eclipse core runtime when using locally built jar?
Any idea to Investigate this error is much appreciated.
pom.xml of my project is as below.
[img]http://[/img]<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>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!--Below is the locally built jdt core jar -->
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.core</artifactId>
<version>3.23.0-SNAPSHOT</version>
</dependency>
<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>
<dependency>
<groupId>org.eclipse</groupId>
<artifactId>osgi</artifactId>
<version>3.10.0-v20140606-1445</version>
</dependency>
</dependencies>
</project>
|
|
|
Re: java.lang.NoSuchMethodError in JDT Core runtime [message #1831299 is a reply to message #1831294] |
Mon, 17 August 2020 01:04  |
Eclipse User |
|
|
|
After experimenting with couple of versions of org.eclipse..runtime, I could successfully run my project with the locally built JDT Core. However I have no idea for the existence of couple of maven repositories for org.eclipse.core.runtime.
I removed below dependency
<dependency>
<groupId>org.eclipse.core</groupId>
<artifactId>runtime</artifactId>
<version>3.10.0-v20140318-2214</version>
</dependency>
I added below dependency.
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.6.0-20160607</version>
</dependency>
I would be grateful to you, If somebody can explain the reason for maintaining multiple maven repositories for `org.eclipse.core`. Thank you.
|
|
|
Powered by
FUDForum. Page generated in 0.03267 seconds