我有一个JavaFX项目。
我已经为binance-api-client包安装了一个依赖项。它在我的依赖项文件夹中
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>13</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>13</version>
</dependency>
<dependency>
<groupId>com.binance.sdk</groupId>
<artifactId>binance-client</artifactId>
<version>1.0.8-SNAPSHOT</version>
</dependency>
</dependencies>然而,当我去导入它的时候。
import com.binance.client.*;上面写着
package com.binance.client is not visible如果我遵循Netbeans的建议,“将模块添加到ModuleInfo”。我在模块信息中得到了这个。
module com.mycompany.btrade {
requires javafx.controls;
requires javafx.fxml;
requires binance.api.client;
opens com.mycompany.btrade to javafx.fxml;
exports com.mycompany.btrade;
}然而,当我运行该程序时,它就崩溃了,并出现以下错误
java.lang.module.FindException: Module binance.api.client not found, required by com.mycompany.btrade为什么我不能导入这个包。
发布于 2021-04-29 14:54:51
我不确定您是否正在尝试使用binance-java-api,如果您只使用Java,那么它就是您想要的,或者是否确实存在其他称为com.binance.sdk的包。
从我看过的文档中,您的依赖项应该是:
<dependency>
<groupId>com.binance.api</groupId>
<artifactId>binance-api-client</artifactId>
<version>1.0.8-SNAPSHOT</version>
</dependency>话虽如此,但我不确定如果您进行了更改,版本控制是否仍然有效,但这可以解释以下错误:
binance.api.client not found, required by com.mycompany.btrade因为它与依赖项所描述的包不匹配。
https://stackoverflow.com/questions/67312220
复制相似问题