[英]importing external jar inside eclipse
I'm writing assignment on coursera.org Java course. 我正在Coursera.org Java课程上写作业。 I'm using Maven and I have external jars that I have to use in this course (course requirements).
我正在使用Maven,并且在此课程中必须使用外部jar(课程要求)。
This is part of my pom.xml: 这是我的pom.xml的一部分:
<dependency>
<groupId>org.coursera.algs4part1</groupId>
<artifactId>stdlib</artifactId>
<version>1.0</version>
</dependency>
I can't make java compiler import the external jar file. 我无法使Java编译器导入外部jar文件。 Below, following errors occur:
下面,发生以下错误:
The import org.coursera.algs4part1.stdlib cannot be resolved
But I've successfully added the jar to maven: 但是我已经成功地将罐子添加到了Maven中:
What am I missing? 我想念什么?
You need to do the following steps if you have a eclipse-maven plugin installed. 如果安装了eclipse-maven插件,则需要执行以下步骤。
mvn eclipse:eclipse
mvn eclipse:eclipse
C:\\Users\\<username>\\.m2\\repository
.) C:\\Users\\<username>\\.m2\\repository
。) 1.create a folder src\\lib and paste your jar file 1.创建一个文件夹src \\ lib并粘贴您的jar文件
2.your pom.xml should be like this. 2.您的pom.xml应该是这样的。
<groupId>org.coursera.algs4part1</groupId>
<artifactId>stdlib</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${basedir}\src\lib\stdlib.jar</systemPath>
</dependency>
Hopefully this will solve your problem and for more details visit http://noexceptionfound.blogspot.in/ 希望这可以解决您的问题,有关更多详细信息,请访问http://noexceptionfound.blogspot.in/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.