将外部 jars (lib/*.jar) 添加到 IntelliJ IDEA 项目的正确方法 [英] Correct way to add external jars (lib/*.jar) to an IntelliJ IDEA project

查看:27
本文介绍了将外部 jars (lib/*.jar) 添加到 IntelliJ IDEA 项目的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 IntelliJ IDEA 中创建新的 Java 项目时,会创建以下目录和文件:

When creating a new Java project in IntelliJ IDEA, the following directories and files are created:

./projectname.iml
./projectname.ipr
./projectname.iws
./src/

我想配置 IntelliJ IDEA 以将 ./lib/*.jar 中的依赖 JAR 包含到项目中.在 IntelliJ IDEA 中实现此目标的正确方法是什么?

I want to configure IntelliJ IDEA to include my dependency JARs in ./lib/*.jar to the project. What is the correct way to achieve this in IntelliJ IDEA?

推荐答案

IntelliJ IDEA中添加外部jar的步骤:

Steps for adding external jars in IntelliJ IDEA:

  1. 点击工具栏中的文件
  2. 选择项目结构选项(CTRL + SHIFT + ALT + S在 Windows/Linux 上, + 在 Mac OS X 上)
  3. 在左侧面板中选择模块
  4. 选择依赖项标签
  5. 选择+图标
  6. 选择1 个 JAR 或目录选项
  1. Click File from the toolbar
  2. Select Project Structure option (CTRL + SHIFT + ALT + S on Windows/Linux, + ; on Mac OS X)
  3. Select Modules at the left panel
  4. Select Dependencies tab
  5. Select + icon
  6. Select 1 JARs or directories option

这篇关于将外部 jars (lib/*.jar) 添加到 IntelliJ IDEA 项目的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆