![](/img/trans.png)
[英]Eclipse error "This compilation unit is not on the build path of a Java project
[英]Eclipse Oxygen This compilation unit is not on build path of java project
我使用 Maven Archetype 創建了一個 Kafka Streams 項目:
mvn archetype:generate \
-DarchetypeGroupId=org.apache.kafka \
-DarchetypeArtifactId=streams-quickstart-java \
-DarchetypeVersion=1.0.0 \
-DgroupId=streams.examples \
-DartifactId=streams.examples \
-Dversion=0.1 \
-Dpackage=myapps
編譯和運行程序:
> mvn clean package
> mvn exec:java -Dexec.mainClass=myapps.Pipe
該程序運行良好。
但是,當我編輯代碼並嘗試Ctrl+Space
我收到了Cannot perform operation
錯誤:
This compilation unit is not on build path of java project.
見下圖:
趕緊跑
mvn eclipse:eclipse
在項目目錄中並在 Eclipse 中刷新您的項目: File -> Refresh
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.