跳至主要內容

IDEA开发工具实践应用

holic-x...大约 4 分钟碎片化碎片化

IDEA开发工具实践应用

参考代码

noob-demo=》java-demo=》HelloWorld

IDEA下载安装

IDEA安装下载官网安装下载open in new window(需要注册码),选择破解版安装(公众号软件管家:下载最新版本IDEA)

​ 下载安装一般不选择关联(否则其他一些文件关联默认用idea打开,可能会比较慢,一般正常文本可以用文本编辑器查看即可)

​ idea2018版本(参考2018.2.5)暴力破解,输入注册码

G91XMO9AVI-eyJsaWNlbnNlSWQiOiJHOTFYTU85QVZJIiwibGljZW5zZWVOYW1lIjoic29uZyB3YW5nIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMDMtMDYifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTktMDMtMDYifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOS0wMy0wNiJ9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDE5LTAzLTA2In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMTktMDMtMDYifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOS0wMy0wNiJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE5LTAzLTA2In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjIwMTktMDMtMDYifSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAxOS0wMy0wNiJ9LHsiY29kZSI6IkFDIiwicGFpZFVwVG8iOiIyMDE5LTAzLTA2In0seyJjb2RlIjoiRFBOIiwicGFpZFVwVG8iOiIyMDE5LTAzLTA2In0seyJjb2RlIjoiR08iLCJwYW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23VmIqqDLgkNzuoog==

​ 项目构建可以新建项目、导入现有项目、从远程仓库导入(版本管理)

补充:idea 激活码备份(idea2024)

LI20LEOSUR-eyJsaWNlbnNlSWQiOiJMSTIwTEVPU1VSIiwibGljZW5zZWVOYW1lIjoi5Ly05ZCbIOi1hOa6kOe9kSIsImxpY2Vuc2VlVHlwZSI6IlBFUlNPTkFMIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IiIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiR08iLCJwYWlkVXBUbyI6IjIwMjQtMDYtMDIiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlJTMCIsInBhaWRVcFRvIjoiMjAyNC0wNi0wMiIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiRE0iLCJwYWlkVXBUbyI6IjIwMjQtMDYtMDIiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IkNMIiwicGFpZFVwVG8iOiIyMDI0LTA2LTAyIiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSU1UiLCJwYWlkVXBUbyI6IjIwMjQtMDYtMDIiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlJTQyIsInBhaWRVcFRvIjoiMjAyNC0wNi0wMiIsImV4dGVuZGVkIjp0cnVlfSx7ImNvZGUiOiJQQyIsInBhaWRVcFRvIjoiMjAyNC0wNi0wMiIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiRFMiLCJwYWlkVXBUbyI6IjIwMjQtMDYtMDIiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDI0LTA2LTAyIiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJSQyIsInBhaWRVcFRvIjoiMjAyNC0wNi0wMiIsImV4d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目:File =》New Project,选择JDK版本和项目存放路径

​ (JDK可以选择本地安装的JDK路径,也可直接在idea中安装导入)

image-20240416090636666

idea安装目录(简单理解每个目录存放的内容和作用),关注idea的配置信息

提高idea启动速度和运行速度:(考虑到一般用户的配置,一些参数配置比较低)

修改idea安装目录下的bin目录中的idea64.exe.vmoptions(64位)配置文件参数

关注前面三个参数:Xms最小启动内存参数、Xmx最大运行内存参数、-XX:ReservedCodeCacheSize保留代码占用的内存容量,可以结合电脑配置调整

参考:16G、i5分别调整:1000m、2000m、500m

-Xms128m
-Xmx2048m
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:+IgnoreUnrecognizedVMOptions
-ea
-Dsun.io.useCanonCaches=false
-Dsun.java2d.metal=true
-Djbr.catch.SIGABRT=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-Djdk.attach.allowAttachSelf=true
-Djdk.module.illegalAccess.silent=true
-Dkotlinx.coroutines.debug=off
-XX:CICompilerCount=2
-XX:ReservedCodeCacheSize=512m
-XX:CompileCommand=exclude,com/intellij/openapi/vfs/impl/FilePartNodeRoot,trieDescend
-XX:SoftRefLRUPolicyMSPerMB=50
-Dide.show.tips.on.startup.default.value=false

idea优化设置:

【1】File=>Settings(基于2018.2.5:或者通过View=>Toolbar调出)

idea主题

image-20240416092924718

设置鼠标悬浮提示

idea2024:默认提供

image-20240416093110025

idea2018.2.5:Editor=》General =》Show quick Documentation on mouse move(delay(ms)设置延迟时间)

设置方法分隔符

image-20240416093656651

image-20240416093749740

忽略大小写提示

​ 对于一些开发关键字,不强制大小写进行提示(例如不用输入System、而是输入system也有提示),提高开发效率

image-20240416094041360

自动导包

​ 一般通过快捷键进行导包,可以配置自动导包、自动去包

image-20240416094433515

取消单行显示tab(用于多个tab切换)

image-20240416094953965

字体设置

image-20240416095117634

文件模板配置

​ Editor=》File and Code Template

/**
 * @ClassName ${NAME}
 * @Description TODO
 * @Author Huh-x
 * @Date ${YEAR} ${DATE} ${TIME}
 */

image-20240416100053345

编码格式

image-20240416095653406

​ 可以设定Transparent自动转化

对比代码

​ eclipse中是拖拉拽tab,idea中可以选择

image-20240416100334223

快捷键

​ 将idea快捷方式修改为eclipse(按照个人开发习惯进行配置)

image-20240416100611171

项目构建

【1】新建module项目

File=》New Module =》选择Java,输入module名称,选择JDK版本进行创建

image-20240416104243958

image-20240416104416541

module移除(如果直接移除module项目则可能存在后遗症,一些项目关联的配置没有修改成功),移除module:右键选择指定module(remove module(移除项目关联)),然后再删除项目

【2】新建静态web项目

​ 2018.2.5版本:File=》New Module =》选择Static Web,可以选择相关的前端框架即可

​ 2024版本:File=》New Module =》选择框架模板即可

​ 最简单的实现就是创建一个Java项目,随后创建html文件,运行测试,然后可通过浏览器访问

【3】新建动态web项目

​ 2018.2.5版本:File=》New Module =》选择Java(Java EE:Web Application,勾选web.xml)

​ 启动配置tomcat运行动态web项目

【4】新建maven项目(配置阿里云镜像)

​ File=》New Module =》选择maven项目进行构建

【5】新建SpringCloud多模块父子依赖构建

【6】IDEA中的debug操作

评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v3.1.3