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

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

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

问题

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

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>AtomicASTChangeMining</groupId>
  5. <artifactId>AtomicASTChangeMining</artifactId>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <repositories>
  8. <repository>
  9. <id>local-maven-repo</id>
  10. <url>file:///Users/xx/Documents/Research_Topic_2/</url>
  11. </repository>
  12. </repositories>
  13. <build>
  14. <sourceDirectory>src</sourceDirectory>
  15. <plugins>
  16. <plugin>
  17. <artifactId>maven-compiler-plugin</artifactId>
  18. <version>3.5.1</version>
  19. <configuration>
  20. <source>11</source>
  21. <target>11</target>
  22. </configuration>
  23. </plugin>
  24. <plugin>
  25. <groupId>org.apache.maven.plugins</groupId>
  26. <artifactId>maven-compiler-plugin</artifactId>
  27. <configuration>
  28. <source>11</source>
  29. <target>11</target>
  30. </configuration>
  31. </plugin>
  32. </plugins>
  33. </build>
  34. <dependencies>
  35. <!--以下是本地构建的jdt core jar-->
  36. <dependency>
  37. <groupId>org.eclipse.jdt</groupId>
  38. <artifactId>org.eclipse.jdt.core</artifactId>
  39. <version>3.23.0-SNAPSHOT</version>
  40. </dependency>
  41. <dependency>
  42. <groupId>org.eclipse.core</groupId>
  43. <artifactId>runtime</artifactId>
  44. <version>3.10.0-v20140318-2214</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>org.eclipse.birt.runtime</groupId>
  48. <artifactId>org.eclipse.core.resources</artifactId>
  49. <version>3.10.0.v20150423-0755</version>
  50. </dependency>
  51. <dependency>
  52. <groupId>org.eclipse</groupId>
  53. <artifactId>osgi</artifactId>
  54. <version>3.10.0-v20140606-1445</version>
  55. </dependency>
  56. </dependencies>
  57. </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.

  1. Exception in thread &quot;pool-2-thread-1&quot; java.lang.NoSuchMethodError: org.eclipse.core.runtime.SubMonitor.split(I)Lorg/eclipse/core/runtime/SubMonitor;
  2. at org.eclipse.jdt.core.dom.ASTParser.createAST(ASTParser.java:820)
  3. at utils.JavaASTUtil.parseSource(JavaASTUtil.java:87)
  4. at change.CFile.&lt;init&gt;(CFile.java:32)
  5. at change.RevisionAnalyzer.buildGitModifiedFiles(RevisionAnalyzer.java:310)
  6. at change.RevisionAnalyzer.analyzeGit(RevisionAnalyzer.java:130)
  7. at change.ChangeAnalyzer.analyzeGit(ChangeAnalyzer.java:243)
  8. at change.ChangeAnalyzer.analyzeGit(ChangeAnalyzer.java:228)
  9. at main.MainChangeAnalyzer$2.run(MainChangeAnalyzer.java:99)
  10. at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
  11. at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
  12. at java.base/java.lang.Thread.run(Thread.java:834)

pom.xml of the project is given below

  1. &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  2. xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
  3. &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  4. &lt;groupId&gt;AtomicASTChangeMining&lt;/groupId&gt;
  5. &lt;artifactId&gt;AtomicASTChangeMining&lt;/artifactId&gt;
  6. &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  7. &lt;repositories&gt;
  8. &lt;repository&gt;
  9. &lt;id&gt;local-maven-repo&lt;/id&gt;
  10. &lt;url&gt;file:///Users/xx/Documents/Research_Topic_2/&lt;/url&gt;
  11. &lt;/repository&gt;
  12. &lt;/repositories&gt;
  13. &lt;build&gt;
  14. &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
  15. &lt;plugins&gt;
  16. &lt;plugin&gt;
  17. &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
  18. &lt;version&gt;3.5.1&lt;/version&gt;
  19. &lt;configuration&gt;
  20. &lt;source&gt;11&lt;/source&gt;
  21. &lt;target&gt;11&lt;/target&gt;
  22. &lt;/configuration&gt;
  23. &lt;/plugin&gt;
  24. &lt;plugin&gt;
  25. &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
  26. &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
  27. &lt;configuration&gt;
  28. &lt;source&gt;11&lt;/source&gt;
  29. &lt;target&gt;11&lt;/target&gt;
  30. &lt;/configuration&gt;
  31. &lt;/plugin&gt;
  32. &lt;/plugins&gt;
  33. &lt;/build&gt;
  34. &lt;dependencies&gt;
  35. &lt;!--Below is the locally built jdt core jar --&gt;
  36. &lt;dependency&gt;
  37. &lt;groupId&gt;org.eclipse.jdt&lt;/groupId&gt;
  38. &lt;artifactId&gt;org.eclipse.jdt.core&lt;/artifactId&gt;
  39. &lt;version&gt;3.23.0-SNAPSHOT&lt;/version&gt;
  40. &lt;/dependency&gt;
  41. &lt;dependency&gt;
  42. &lt;groupId&gt;org.eclipse.core&lt;/groupId&gt;
  43. &lt;artifactId&gt;runtime&lt;/artifactId&gt;
  44. &lt;version&gt;3.10.0-v20140318-2214&lt;/version&gt;
  45. &lt;/dependency&gt;
  46. &lt;dependency&gt;
  47. &lt;groupId&gt;org.eclipse.birt.runtime&lt;/groupId&gt;
  48. &lt;artifactId&gt;org.eclipse.core.resources&lt;/artifactId&gt;
  49. &lt;version&gt;3.10.0.v20150423-0755&lt;/version&gt;
  50. &lt;/dependency&gt;
  51. &lt;dependency&gt;
  52. &lt;groupId&gt;org.eclipse&lt;/groupId&gt;
  53. &lt;artifactId&gt;osgi&lt;/artifactId&gt;
  54. &lt;version&gt;3.10.0-v20140606-1445&lt;/version&gt;
  55. &lt;/dependency&gt;
  56. &lt;/dependencies&gt;
  57. &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:

确定