将Jar文件添加到IntellijIdea类路径 [英] Adding Jar files to IntellijIdea classpath
问题描述
我创建了一个新的Intellij项目。但我不能在我的项目中使用第三方罐子。我在目录结构中有如下jar:
repository / commons-logging / commons-logging-1.0.4.jar
repository / commons-lang / commons-lang-2.1.jar
等。
I have created a new Intellij project. But I can't use the third party jars in my project. I have the jars in a directory structure as follows:
repository/commons-logging/commons-logging-1.0.4.jar
repository/commons-lang/commons-lang-2.1.jar
etc.
我想通过指向存储库目录来添加它们,但找不到任何添加它们的方法。
但是当我使用该jar中的类或API时,编辑器无法解析这些类。
我已尝试从项目结构但无法配置它。
I want to add them just by pointing to the repository directory, but couldn't find any ways to add them. But when I am using classes or API from that jars, the editor can't resolve the classes. I have tried from Project Structure but can't configure it.
推荐答案
转到文件 - >项目结构 - > Libraries并单击绿色+将具有JAR的目录文件夹添加到CLASSPATH。该文件夹中的所有内容都将添加到CLASSPATH。
Go to File-> Project Structure-> Libraries and click green "+" to add the directory folder that has the JARs to CLASSPATH. Everything in that folder will be added to CLASSPATH.
这篇关于将Jar文件添加到IntellijIdea类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!