Eclipse JDT核心Java运行时错误 – java.lang.NoSuchMethodError

huangapple go评论87阅读模式
英文:

Eclipse JDT core Java runtime error - java.lang.NoSuchMethodError

问题

抱歉,由于您的要求,我只能提供代码部分的翻译。以下是您提供的内容的代码部分的翻译:

<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>
		<!--以下是本地构建的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>

如果您有更多需要翻译的内容或其他问题,请随时提问。

英文:

I could not find any helping document regarding this error hence I am posting this question.

I am trying to use locally built Eclipse JDT core jar in my project. I followed the flowing steps.

  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 that is created in the target folder to my project (i.e., project A) as a maven dependency.

After the above steps, I could successfully compile project A and now it gives me the following runtime error.

Exception in thread &quot;pool-2-thread-1&quot; 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.&lt;init&gt;(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)

pom.xml of the project is given below

&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
	xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
	&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
	&lt;groupId&gt;AtomicASTChangeMining&lt;/groupId&gt;
	&lt;artifactId&gt;AtomicASTChangeMining&lt;/artifactId&gt;
	&lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
	&lt;repositories&gt;
		&lt;repository&gt;
			&lt;id&gt;local-maven-repo&lt;/id&gt;
			&lt;url&gt;file:///Users/xx/Documents/Research_Topic_2/&lt;/url&gt;
		&lt;/repository&gt;
	&lt;/repositories&gt;
	&lt;build&gt;
		&lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
		&lt;plugins&gt;
			&lt;plugin&gt;
				&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
				&lt;version&gt;3.5.1&lt;/version&gt;
				&lt;configuration&gt;
					&lt;source&gt;11&lt;/source&gt;
					&lt;target&gt;11&lt;/target&gt;
				&lt;/configuration&gt;
			&lt;/plugin&gt;
			&lt;plugin&gt;
				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
				&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
				&lt;configuration&gt;
					&lt;source&gt;11&lt;/source&gt;
					&lt;target&gt;11&lt;/target&gt;
				&lt;/configuration&gt;
			&lt;/plugin&gt;
		&lt;/plugins&gt;
	&lt;/build&gt;
	&lt;dependencies&gt;
        &lt;!--Below is the locally built jdt core jar --&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;org.eclipse.jdt&lt;/groupId&gt;
            &lt;artifactId&gt;org.eclipse.jdt.core&lt;/artifactId&gt;
            &lt;version&gt;3.23.0-SNAPSHOT&lt;/version&gt;
        &lt;/dependency&gt;
		&lt;dependency&gt;
			&lt;groupId&gt;org.eclipse.core&lt;/groupId&gt;
			&lt;artifactId&gt;runtime&lt;/artifactId&gt;
			&lt;version&gt;3.10.0-v20140318-2214&lt;/version&gt;
		&lt;/dependency&gt;
		&lt;dependency&gt;
			&lt;groupId&gt;org.eclipse.birt.runtime&lt;/groupId&gt;
			&lt;artifactId&gt;org.eclipse.core.resources&lt;/artifactId&gt;
			&lt;version&gt;3.10.0.v20150423-0755&lt;/version&gt;
		&lt;/dependency&gt;

		&lt;dependency&gt;
			&lt;groupId&gt;org.eclipse&lt;/groupId&gt;
			&lt;artifactId&gt;osgi&lt;/artifactId&gt;
			&lt;version&gt;3.10.0-v20140606-1445&lt;/version&gt;
		&lt;/dependency&gt;


	&lt;/dependencies&gt;
&lt;/project&gt;

Does anybody have any idea about the runtime error?
Thanks a lot!

答案1

得分: 2

org.eclipse.core.runtime.SubMonitor实际上位于org.eclipse.equinox.common插件中。

根据Javadoc,在org.eclipse.equinox.common的版本3.8中添加了SubMonitorsplit方法。这对应于Eclipse 4.6版本的发布。

英文:

org.eclipse.core.runtime.SubMonitor is actually in the org.eclipse.equinox.common plug-in.

According to the Javadoc the split methods were added to SubMonitor in version 3.8 of org.eclipse.equinox.common. This corresponds to Eclipse release 4.6.

答案2

得分: 1

在 org.eclipse.core 版本上进行实验。您可能需要升级 org.eclipse.birt.runtime 的版本。选择包含方法 SubMonitor.split() 的版本。

英文:

Do experiments on org.eclipse.core version. You might need to upgrade the version of org.eclipse.birt.runtime. Select the version that contains the method SubMonitor.split().

huangapple
  • 本文由 发表于 2020年8月17日 06:46:08
  • 转载请务必保留本文链接:https://go.coder-hub.com/63442629.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定