簡體   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