大家好,又见面了,我是你们的朋友全栈君。
一、导入
1、java项目在没有导入该jar包之前,如图:
2、 File -> Project Structure(快捷键 Ctrl + Alt + Shift + s),Project Structure界面左侧的“Modules”如图:
3、在 “Dependencies” 标签界面下,右边绿色的 “+”号,选择第一个选项“JARs or directories…”,选择相应的jar包,点“OK”,jar包添加成功
4、点“OK”回到项目界面,IntelliJ IDEA自动提示需要添加import语句,利用 Alt+Enter 键快速添加import语句之后,项目成功编译
二、打jar包
1、 File -> Project Structure(快捷键 Ctrl + Alt + Shift + s),Project Structure界面左侧的“Artifacts”如图:
2、Artifacts->”+”,选jar,选择from modules with dependencies,后有配置窗口出现,配置完成后,勾选Build on make >ok保存
3、菜单:Build->make project,注意这里可能会报编译错误,最好提前检查一下编译器版本:File>Settings>Java Compiler,修改Target bytecode version版本为1.8,另外项目版本Project Structure-Project/Modules版本改为1.8
以下是检查编译器版本截图,不需时可忽略:
(1)File>Settings>Java Compiler,修改Target bytecode version版本为1.8
(2)Project Structure>Project/Modules版本改为1.8
4、去打包输出路径,找到jar包
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/125000.html原文链接:https://javaforall.cn
今天的文章
idea中如何导入jar包分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/133204.html
![idea中如何导入jar包插图1 IDEA导入jar包[通俗易懂]](https://bianchenghao.cn/wp-content/uploads/2022/12/2022122605452522.jpg)
![idea中如何导入jar包插图3 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/pPM43k70.jpeg)
![idea中如何导入jar包插图5 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/e81C0.jpeg)
![idea中如何导入jar包插图7 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/n5PcC.jpeg)
![idea中如何导入jar包插图9 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/MHktAbDs.jpeg)
![idea中如何导入jar包插图11 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/jZu0JU1m.jpeg)
![idea中如何导入jar包插图13 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/k6d349F05.jpeg)
![idea中如何导入jar包插图15 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/7dwIWK.jpeg)
![idea中如何导入jar包插图17 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/IPc4rQgk.jpeg)
![idea中如何导入jar包插图19 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/PM82ruv.jpeg)
![idea中如何导入jar包插图21 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/f08Wzs.jpeg)
![idea中如何导入jar包插图23 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/SJWf8y5Vfz.jpeg)
![idea中如何导入jar包插图25 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/0r1cg9.jpeg)
![idea中如何导入jar包插图27 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/84pgD9.jpeg)
![idea中如何导入jar包插图29 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/1f1NGPWuSZ.jpeg)
![idea中如何导入jar包插图31 IDEA导入jar包[通俗易懂]](http://bianchenghao.cn/wp-content/uploads/2024/08/tBrd7p.jpeg)