简体   繁体   English

如何使用 Maven 解决对 JNLP 的依赖

[英]How to resolve dependencies on JNLP with Maven

I'm working on a Slick 2D project, with JDK 15, using Eclipse 09-2020, and I am resolving my dependencies via Maven.我正在使用 Eclipse 09-2020 使用 JDK 15 处理 Slick 2D 项目,并且我正在通过 Maven 解决我的依赖项。 When I add Slick2D to pom.xml, it shows an error in the IDE at xsi:schemaLocation, saying "Missing artifact javax.jnlp:jnlp-api:jar:5.0"当我将 Slick2D 添加到 pom.xml 时,它在 IDE 中的 xsi:schemaLocation 显示错误,说“缺少工件 javax.jnlp:jnlp-api:jar:5.0”

I've tried re-downloading Java, resetting my JAVA_HOME variable, but to no avail.我试过重新下载 Java,重置我的 JAVA_HOME 变量,但无济于事。 The other problems that I've come across reference "javaw.jar" in the lib directory, but that is not present in my JDK.我遇到的其他问题在 lib 目录中引用了“javaw.jar”,但在我的 JDK 中不存在。 How do I solve this?我该如何解决这个问题?

Here's my pom.xml, if it helps:这是我的 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.newproject</groupId>
<artifactId>newapi</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Slick Based API</name>

<dependencies>
    <dependency>
        <groupId>org.slick2d</groupId>
        <artifactId>slick2d-core</artifactId>
        <version>1.0.2</version>
    </dependency>
</dependencies>

Just a general note: The slick project seems dead.只是一个一般性的说明:这个漂亮的项目似乎已经死了。 The official source repo has been taken offline .官方源代码库已下线 I would probably not use it for a completely new project.我可能不会将它用于一个全新的项目。 But now to your question:但现在你的问题:

Java Webstart has been removed starting from Java11 since oracle did not opensource it. Java Webstart 从 Java11 开始被移除,因为 oracle 没有开源它。 So what can you do?所以,你可以做什么?

  1. You downgrade to Java 9/10您降级到 Java 9/10
  2. You use https://openwebstart.com (some adaptions might be necessary)您使用https://openwebstart.com (可能需要进行一些调整)
  3. You remove JNLP from the project (since there are other means to start it)您从项目中删除 JNLP(因为还有其他方法可以启动它)

Some other guy seems to have taken up the project.其他人似乎已经接手了这个项目。 You can find it on github .你可以在github上找到它。 In one of the forks JNLP has been removed, too.在其中一个分支中, JNLP 也已被删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM