繁体   English   中英

如何使用 Maven californium 运行 helloWorld - Java

[英]How to run helloWorld using Maven californium - Java

我是 Java 环境的新手,我正在尝试使用Californium https://github.com/eclipse-californium/californium运行Coap服务器

我克隆了 git 存储库。 然后在 repo 文件夹中运行mvn clean install 我现在想在californium/demo-apps/cf-helloworld-server/中运行 hello world 演示

你下一步怎么做?

我打开文件夹cd demo-apps/cf-helloworld-server然后运行

  • mvn clean install
  • mvn compile

它工作没有错误,现在如何运行服务器?

如果我运行:

java target.classes.org.eclipse.californium.examples.HelloWorldServer

我收到这个错误

Error: Unable to initialize main class org.eclipse.californium.examples.Server
Caused by: java.lang.NoClassDefFoundError: org/eclipse/californium/elements/exception/ConnectorException

请不要只构建一个演示应用程序,它不能从头开始工作。

而是使用

mvn 干净安装

然后切换到应用程序目录,例如“demo-apps/cd-helloworld-server”。 在那里你启动服务器

“java -jar 目标/cf-helloworld-server-3.7.0-SNAPSHOT.jar”

你得到 output:

Californium (Cf) Server-Starter (c) 2020, Bosch.IO GmbH 等

用法:服务器(HelloWorldServer|MulticastTestServer)

遵循用法:

“java -jar 目标/cf-helloworld-server-3.7.0-SNAPSHOT.jar HelloWorldServer”

然后运行 HelloWorldServer。

暂无
暂无

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

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