Apache MINA sshd |当我添加依赖项并将其导入 class 时,出现 "the type org.apache.sshd.client.SshClient is not accessible" 错误

Apache MINA sshd | When I added the dependency and import it in the class I get "the type org.apache.sshd.client.SshClient is not accessible" error

我使用 Java 11JavaFX。当我将 Apache MINA 添加为 Maven 依赖项,然后在 java class 中执行导入语句时,我收到以下错误消息:

“类型 org.apache.sshd.client.SshClient 不可访问”

我添加了依赖:

<dependency>
        <groupId>org.apache.sshd</groupId>
        <artifactId>sshd-core</artifactId>
        <version>2.8.0</version>
</dependency>

然后我导入到class:

import org.apache.sshd.client.SshClient;

但是没用。我收到上述错误。 我究竟做错了什么?请帮忙。

据我所知,Mina 库 2.8.0 不是模块化的,因此如果您没有模块信息,访问和使用它可能会更容易。

创建一个没有模块 info.java 文件的非模块化应用程序。将您的应用程序代码以及 Mina 库和依赖项放在 class 路径上。通过命令行开关添加 JavaFX 模块,因为这些模块需要通过模块路径访问,而不是 class 路径。

请参阅 openjfx.io getting started 上有关 non-modular 应用程序的相关文档。