简体   繁体   中英

Error: Could not find or load main class after adding dependency (maven)

In Java project I use Maven as a project manager. To my project's pom.xml file I add the following dependency:

<dependency>
        <groupId>org.neo4j</groupId>
        <artifactId>neo4j</artifactId>
        <version>2.1.0-M01</version>
</dependency>

When I try to run the project I get an error:

Could not find or load main class 'package.className'

I'm using Eclipse 4.2 Keppler with m2e plugin.

在Debian(可能也是其他Linux)上,您应该删除〜/〜/ .m2 / repository文件夹,然后在Eclipse中右键单击项目Maven-> Update Project...。

在Eclipse工作台模式下,选择项目,然后单击Alt + F5来更新该项目的Maven依赖项。请告诉我它是否解决了问题

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