OpenNLP: 类文件版本错误,应为 52.0,而不是 55.0

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

OpenNLP: Class file has wrong version 55.0, should be 52.0

问题

我在 IntelliJ IDEA 版本 17.0.6 中使用 Open NLP(版本 apache-opennlp-2.2.0)库,但我收到以下消息:

  错误的类文件: /C:/Users/HaMza/IdeaProjects/JournalOff/.idea/libraries/opennlp-tools-2.2.0/opennlp-tools-2.2.0.jar!/opennlp/tools/namefind/NameFinderME.class
    类文件版本错误 55.0,应为 52.0
    请删除或确保它出现在类路径的正确子目录中。

我尝试下载更新版本的 Open NLP,但仍然收到相同的消息。

英文:

I'm using Open NLP (Version apache-opennlp-2.2.0) library in IntelliJ IDEA version 17.0.6, but I get the following message:

java: cannot access opennlp.tools.namefind.NameFinderME
  bad class file: /C:/Users/HaMza/IdeaProjects/JournalOff/.idea/libraries/opennlp-tools-2.2.0/opennlp-tools-2.2.0.jar!/opennlp/tools/namefind/NameFinderME.class
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

I did try to download neweer versions of Open NLP but i keep getting the same message.

答案1

得分: 2

Class文件格式52对应Java 8,55对应Java 11。

由于您尝试在配置为使用Java 8的项目中使用为Java 11编译的库,因此您的应用程序构建失败。

确保您正在使用最新版本的Java(例如,截至2023年05月28日的最新LTS版本 - JDK 17)。然后相应地配置您的项目和构建工具。

在IntelliJ中,您可能希望更改项目的SDK和语言级别。有关如何执行此操作的更多信息,请参阅IDEA的SDK文档

英文:

Class file format 52 corresponds to Java 8, 55 corresponds to Java 11.

Your application is failing to build because you are trying to use a library compiled for Java 11 with a project configured to use Java 8.

Make sure that you are using an up-to-date version of Java (e.g., the latest LTS version - JDK 17 as of 2023-05-28). Then configure your project and build tools accordingly.

In IntelliJ you will likely want to change the project's SDK and language level. For more information on how to do this, have a look at IDEA's documentation on SDKs.

huangapple
  • 本文由 发表于 2023年5月29日 05:17:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76353636.html
匿名

发表评论

匿名网友

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

确定