简体   繁体   English

如何在我的项目 (Eclipse) 中使用 .JAR 文件类

[英]How to use a .JAR file class in my project (Eclipse)

I am trying to use a class from org.apache.commons.lang3.ArrayUtils;我正在尝试使用 org.apache.commons.lang3.ArrayUtils 中的一个类;

I have alread imported the .JAR file into my classpath in ecplise.我已经将 .JAR 文件导入到 ecplise 中的类路径中。 You can see in the picture below.你可以在下面的图片中看到。

https://i.stack.imgur.com/cg2YJ.png [< image here ] https://i.stack.imgur.com/cg2YJ.png [<这里的图片]

When I hover over the error for ArrayUtils.indexOf (circle in blue).当我将鼠标悬停在 ArrayUtils.indexOf(蓝色圆圈)的错误上时。 It gives me no option to import class for ArrayUtils.它让我无法选择为 ArrayUtils 导入类。

This is a photo of the .JAR: https://i.stack.imgur.com/WN7pw.png这是 .JAR 的照片: https ://i.stack.imgur.com/WN7pw.png

I cannot figure out how to use ArrayUtils in my code without an error.我无法弄清楚如何在我的代码中使用 ArrayUtils 而不会出错。

I am still learning Java any help will be appreciated, I have looked at a similar question already: how do I import org.apache.commons.lang3.ArrayUtils;我仍在学习 Java 任何帮助将不胜感激,我已经看过一个类似的问题: 如何导入 org.apache.commons.lang3.ArrayUtils; into Eclipse 进入 Eclipse

and it did not help me specifically.它并没有特别帮助我。

Also, import on the top另外,在顶部导入

import org.apache.commons.lang3.ArrayUtils ;导入org.apache.commons.lang3.ArrayUtils

shortcut key to import in eclipse is ctrl+space eclipse导入的快捷键是ctrl+space

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Eclipse中将Jar文件用作Java项目 - How to use Jar file As a Java project in Eclipse 如何在Eclipse中将.jar文件的内容用作项目? - How to use the content of a .jar file as project in Eclipse? 如何在Eclipse Project中使用Netbeans Jar文件 - How to use Netbeans Jar file in Eclipse Project 如何从jar文件向我的项目中的项目中添加几个类? - How to add few classes from a jar file to my project in eclipse? 如何在Eclipse中将可执行的jar文件添加到我的项目中? - How to add an executable jar file to my project in Eclipse? 如何在Eclipse中将QtJambi项目导出到.JAR文件? - How to export my QtJambi project to .JAR file within Eclipse? 如何在 IntelliJ 项目中使用 Jar 文件中的 class? - How do I use a class from my Jar file in my IntelliJ project? 如何在eclipse上用我的java类文件更新外部jar - how to update a external jar with my java class file on eclipse 如何在eclipse中为maven servlet项目生成一个可执行的jar文件并使用jar文件执行一个类? - How to generate an executable jar file for a maven servlet project in eclipse and execute a class using the jar file? 如何将jar文件作为项目导入eclipse中,以使用该jar类的源代码 - How to import a jar file into eclipse as a project to use source code of classes of that jar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM