当前位置:网站首页>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.
1 )创建 m o d u l e 代码项目 \textcolor{red}{1)创建module代码项目} 1)创建module代码项目
2 )方式二:创建 m o d u l e \textcolor{red}{2)方式二:创建module} 2)方式二:创建module
3 )删除 m o d u l e : \textcolor{red}{3)删除module:} 3)删除module:
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
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自带的模板
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)自定义模板
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
之后把MAVEN_HOME配置到path中 :%MAVEN_HOME%\bin
测试maven:cmd 输入 mvn -version
测试是否有maven的版本号
3.1)maven的目录结构介绍
在 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包快)
本地仓库的作用 \textcolor{red}{本地仓库的作用} 本地仓库的作用:
配置阿里云的镜像 \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
3.3)什么是groupid和artifactId?怎么理解?
(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连接数据库
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版本的即可
5、IDEA代码分栏
边栏推荐
猜你喜欢
三面(技术 +HR 面试)网易,分享我的面试经验!(已拿 offer)
渗透测试——CFS三层靶机内网渗透实操
qq机器人账号不能发送群消息,被风控
开源一夏 | 基于若依架构的列表详情展示
[免费专栏] Android安全之APK动态方式逆向应用【三种Smali注入方法】
loadrunner script -- parameterization
[免费专栏] Android安全之Xposed插件开发【从零手把手带】教程
没有 accept,建立 TCP 连接,可以吗?
Open Source Summer | List Details Display Based on Ruoyi Architecture
读大学有用吗?
随机推荐
Open Source Summer | List Details Display Based on Ruoyi Architecture
WPF 实现带蒙版的 MessageBox 消息提示框
重庆智博会|2022智博会到底有哪些看点?拭目以待
Samsung's flagship discount is 1,800, Apple's discount is over 1,000, and the domestic flagship is only reduced by 500 to send beggars
C#/VB.NET: Extract text and pictures from PowerPoint document
Detailed explanation of VIT transformer
发布sensor_msgs/Range数据
Qt 5.12 LTS 部署
mysql双主备份失败?
Ng DevUI 周下载量突破1000啦!
没有 accept,建立 TCP 连接,可以吗?
URLError: <urlopen error [Errno 11004] getaddrinfo failed>调用seaborn-data无法使用
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
史上最全架构师知识图谱(纯干货)
[免费专栏] Android安全之GDB动态调试APP
如何抑制告警风暴?
shell脚本基础语句使用(一)
Pytorch 固定部分参数训练
什么是藏宝计划(TPC),2022的一匹插着翅膀的黑马!
PHP 变量注释/**@var*/