当前位置:网站首页>IDEA tools commonly used configuration
IDEA tools commonly used configuration
2022-08-09 21:19:00 【Presumptuous youth ゛つ】
1、IDEACreate empty project and Module
在实际的开发中,A project may consist of multiple projects.
IDEA中的 p r o j e c t \textcolor{red}{project} project类似于eclipse中的一个workspace, 类似一个文件夹 \textcolor{red}{类似一个文件夹} 类似一个文件夹.
IDEA中的 m o d u l e \textcolor{red}{module} module则类似于eclipse中的project, A concrete code project \textcolor{red}{A concrete code project} A concrete code project.
一般,可以创建一个empty的project,然后在project中创建各种module.


![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ehnQp7Ij-1658564700846)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220629234001420.png)]](/img/a1/da3693bd8c92feb32341f38ee4a577.png)
1 )创建 m o d u l e 代码项目 \textcolor{red}{1)创建module代码项目} 1)创建module代码项目
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-XE6kU1Mh-1658564700846)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220629234206558.png)]](/img/9c/d684244595dcfdbe230deb41db9d42.png)
2 )方式二:创建 m o d u l e \textcolor{red}{2)方式二:创建module} 2)方式二:创建module
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-nln3vdMW-1658564700847)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220629235631612.png)]](/img/a6/2700d2cb6d33247157cb13beb433c2.png)
3 )删除 m o d u l e : \textcolor{red}{3)删除module:} 3)删除module:
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-lShqpVhn-1658564700847)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220629235717461.png)]](/img/17/51cfe23def09be862e3a5f6d1831b6.png)
4 )Make the project a directory,其中包括多个 m o d u l e 【It is more common in creating microservices】 \textcolor{red}{4)Make the project a directory,其中包括多个module【It is more common in creating microservices】} 4)Make the project a directory,其中包括多个module【It is more common in creating microservices】
把项目中的src删除,只保留xxx.iml文件,在创建module, Need to pay attention to the location information of the catalog file \textcolor{red}{Need to pay attention to the location information of the catalog file} Need to pay attention to the location information of the catalog file
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sW0m0yXf-1658564700848)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630001438914.png)]](/img/40/e2222f46e8dfa4e0580d99c68adf21.png)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-hO6mwquj-1658564700848)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630001521724.png)]](/img/cc/9def732c1d3a090c4de9e5851d3f46.png)
2、IDEA快捷键
| 快捷键 | 说明 |
|---|---|
| ctr + / | 单行注释 |
| ctr + shift + / | 多行注释 |
| alt + shift + down键 | 向下移动行(该行代码) |
| alt + shift + up 键 | 向上移动行(该行代码) |
| Alt + insert | 生成代码(get set toString等方法) 生成返回变量 记得 N u m L k \textcolor{red}{记得NumLk} 记得NumLk |
| ctr + d | 向下复制一行(The line content is copied to the next line) |
| ctr + o | 重写方法 |
| shift + 上下键 | 选中多行 |
| ctr + X | 删除行 |
| ctr + P | 方法参数提示 |
| ctr + alt + L | 格式化代码( Q Q 快捷键冲突 \textcolor{red}{QQ快捷键冲突} QQ快捷键冲突) |
3、IDEA模板 - Templates
代码模板 \textcolor{red}{代码模板} 代码模板:Refers to the configuration of some commonly used code letter abbreviations,When entering abbreviations,IDEA自动提示,补全代码.
内置模板 \textcolor{red}{内置模板} 内置模板:IDEA自带的模板
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-29lepJQo-1658564700849)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630102550448.png)]](/img/fc/be4f599dfed103d5604aa50055bfaa.png)
1)Description of common templates
| 模板 | 说明 | 效果 |
|---|---|---|
| psvm / main | 生成main方法 | public void static main(String []args){ } |
| sout | 生成输出语句 | System.out.println(); |
| fori | 生成for循环 | for(int i =0 i < ; i++){ } |
| list.for | 生成集合list的for循环 | |
| i f n \textcolor{red}{ifn} ifn | 判断是否为null | if (args == null) { } |
| . v a r \textcolor{red}{.var} .var | 生成变量名 |
2)自定义模板
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gBNJ2cmz-1658564700849)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630103441126.png)]](/img/04/11be91d9a0d1971687b297b596ad2a.png)
3、maven的安装和配置
mavenIt is an installation-free program,解压就可以使用, 需要使用 m a v e n 的指令,则需要配置 m a v e n 的环境变量 \textcolor{red}{需要使用maven的指令,则需要配置maven的环境变量} 需要使用maven的指令,则需要配置maven的环境变量,maven本身使用Java开发,也依赖JDK的环境变量.
下载 m a v e n ,解压 m a v e n ,配置 m a v e n \textcolor{red}{下载maven,解压maven,配置maven} 下载maven,解压maven,配置maven
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-4rbulPVT-1658564700849)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630174451822.png)]](/img/d5/7d40adfaf9087f285ad526f19fcd74.png)
之后把MAVEN_HOME配置到path中 :%MAVEN_HOME%\bin
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-S5YlkFP1-1658564700850)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630174741854.png)]](/img/fb/3ef333770744394fb59dff82cfdd75.png)
测试maven:cmd 输入 mvn -version
测试是否有maven的版本号
3.1)maven的目录结构介绍
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-sUOC3YJF-1658564700850)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630175756841.png)]](/img/c8/38130fe9636c3432fa5fe4805723b5.png)
在 c o n f 的 s e t t i n g . x m l 配置镜像信息(下载 j a r 包快) \textcolor{red}{在conf的setting.xml配置镜像信息(下载jar包快)} 在conf的setting.xml配置镜像信息(下载jar包快)
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-G2KSZujn-1658564700851)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630175527724.png)]](/img/ba/aa20f0ba473f9767097ef50e01482a.png)
本地仓库的作用 \textcolor{red}{本地仓库的作用} 本地仓库的作用:
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-OlyF6XWr-1658564700851)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630180258054.png)]](/img/60/d448ab5280d84dda49397f8181f748.png)
配置阿里云的镜像 \textcolor{red}{配置阿里云的镜像} 配置阿里云的镜像
<mirrors>
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
3.2)IDEA中配置maven
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-gi6FNZOG-1658564700852)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630180721633.png)]](/img/04/c07d25177bbdd31aaf3ad73ca66737.png)
3.3)什么是groupid和artifactId?怎么理解?
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JwslxDxE-1658564700852)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630181228337.png)]](/img/0b/ee3914a427a23838f5fdc2b44dad34.png)
(1)groupid和artifactId被统称为坐标,In order to ensure the uniqueness of the project proposed
groupid一般分为多段,The first segment is the domain,The second paragraph is the company name,如org.apache
(2)artifactIdDefines which current project is in leaseID
4、IDEA连接数据库
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RVIdWjJz-1658564700852)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630190719382.png)]](/img/20/3ac1aaa13238041f1dc7c3f24d61cc.png)
I D E A 连接数据库错误: [ 08001 ] C o u l d n o t c r e a t e c o n n e c t i o n t o d a t a b a s e s e r v e r . \textcolor{red}{IDEA连接数据库错误:[08001] Could not create connection to database server.} IDEA连接数据库错误:[08001]Couldnotcreateconnectiontodatabaseserver.
把mysql-connect-java的jar包改成8版本的即可
![[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-KXNncBPM-1658564700853)(C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20220630223735323.png)]](/img/38/7b469f0585ec9fcd6cb757bd5bb37c.png)
5、IDEA代码分栏

边栏推荐
猜你喜欢
随机推荐
混动产品助力,自主SUV市场格局迎来新篇章
毕昇编译器优化:Lazy Code Motion
什么是藏宝计划(TPC),2022的一匹插着翅膀的黑马!
牛客网 Verilog 在线编程题库解答(VL1~VL10)
软件设计的七大原则
什么是ROS
从功能测试到自动化测试你都知道他们的有缺点吗?
ARM Assembly Basics
Ros简介
100+开箱即用的AI工具箱;程序员150岁长寿指南;『地理空间数据科学』课程资料;Graphic数据可视化图表库;前沿论文 | ShowMeAI资讯日报
MYSQL物理存储文件的页和INNOBUF的页是否有大小区别?
Bi Sheng Compiler Optimization: Lazy Code Motion
正则表达式(全)
ceph集群部署
Mysql 表结构变更方案对比及分析
字节二面,差点倒在了MySQL上面
golang单元测试:testing包的基本使用
grafana docks local ldap
uniapp离线推送华为厂商申请流程
[Free Column] Android Security for Peace Elite (FZ) APK Reverse Analysis








![[免费专栏] Android安全之ZIP文件目录遍历漏洞](/img/11/c9116562b0ce57205e73fc442874d3.png)
