简体   繁体   中英

Eclipse Oxygen This compilation unit is not on build path of java project

I have created a Kafka Streams Project using Maven Archetype:

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

Compiling and running the program:

> mvn clean package
> mvn exec:java -Dexec.mainClass=myapps.Pipe

The program works fine.

However when I am editing the code and try Ctrl+Space I am getting Cannot perform operation error:

This compilation unit is not on build path of java project.

See the image below:

在此处输入图片说明

Just run

mvn eclipse:eclipse

in the project directory and refresh your project in eclipse: File -> Refresh

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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