IntelliJ: How to add all jar files in a folder to classpath

僤鯓⒐⒋嵵緔 提交于 2019-12-02 07:22:29
Srikanth A

1.) Folders can be added as class path in build, However the directory is expected to contain classes. Refer here for more details - Add directory in class path intelliji

2.) With respect to jars from local Maven repository, It can be achieved only by opening the Maven project in Intelliji using (Alt + F + O)

(Alt + F + O) and specify the path to pom.xml (the Maven project descriptor file). IntelliJ IDEA creates a project based on the Maven Project descriptor file

Ensure you congigure Maven settings in Intelliji at

File -> Settings -> Build, Execution, Deployment -> Maven

Give the same local repository path and maven settings file here.

Post which, do a mvn clean install -o . This build will pick up jars from local repository, which is already available. However, it may try and download pom files for the first time - ensure Internet is connected.

3.) Alternatively, You can do a find *.jar inside local maven repository path - Copy paste to an location and refer those jars in Intelliji as libraries.

What finally solved this issue was re-opening a new Project by: File -> New -> Project -> Maven -> mark "Create from archetype" -> org.apache.maven.archetypes: maven-archetype-quickstart" -> ...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!