IDEA实用技巧

目录

什么是IDEA

IDEA视频教程

IDEA教程

IDEA的下载地址在哪里

怎样查看IDEA Maven项目的依赖关系

常见快捷方式有哪些

字体怎样设置

项目编码在哪里设置

怎样设置Maven

中文乱码问题

Java 非法字符\ufeff 报错解决方法

怎样调整应用程序启动时候所占内存大小

如果编译出现找不类的情况

Spring Assistant插件介绍

Lombok插件是什么

智能提示代码功能

快捷键在哪里

自动提示参数

实现自动转义

什么是Live Template

怎样设置文件头的注释信息

怎样全局设置JDK

怎样全局设置Maven

怎样给IDEA增加依赖

IDEA对接码云操作

IDEA打开码云上的代码


什么是IDEA

IDEA是Java最优秀的开发工具:功能全面、提示智能、开发不卡顿、新技术支持快。

IDEA分为社区版和开发版,社区版免费,商业版功能强大。商业版提供30天试用。

IDEA视频教程

开发工具IDEA从入门到爱不释手-慕课网

IDEA教程

IntelliJ IDEA的剪切、复制和粘贴_w3cschool

IDEA的下载地址在哪里

当然是去官网下载。

下载地址:Download IntelliJ IDEA: The Capable & Ergonomic Java IDE by JetBrains

下载界面展示:

怎样查看IDEA Maven项目的依赖关系

1 方法一:通过IDEA界面查看

2 方法二:通过Terminal控制台查看

打开Terminal控制台,在当前项目(pom文件)路径输入命令:

mvn dependency:tree

结果显示如下:

[INFO] com.didispace:api-gateway:jar:1.0.0
[INFO] +- org.springframework.cloud:spring-cloud-starter-zuul:jar:1.1.5.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter:jar:1.1.1.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter:jar:1.3.7.RELEASE:compile
[INFO] |  |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.3.7.RELEASE:compile
[INFO] |  |  |  |  +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] |  |  |  |  |  \- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] |  |  |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.21:compile
[INFO] |  |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.21:compile
[INFO] |  |  |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.21:compile
[INFO] |  |  |  +- org.springframework:spring-core:jar:4.2.7.RELEASE:compile
[INFO] |  |  |  \- org.yaml:snakeyaml:jar:1.16:runtime
[INFO] |  |  +- org.springframework.cloud:spring-cloud-context:jar:1.1.1.RELEASE:compile
[INFO] |  |  |  \- org.springframework.security:spring-security-crypto:jar:4.0.4.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-commons:jar:1.1.1.RELEASE:compile
[INFO] |  |  \- org.springframework.security:spring-security-rsa:jar:1.0.1.RELEASE:compile
[INFO] |  |     \- org.bouncycastle:bcpkix-jdk15on:jar:1.47:compile
[INFO] |  |        \- org.bouncycastle:bcprov-jdk15on:jar:1.47:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-web:jar:1.3.7.RELEASE:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.3.7.RELEASE:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.0.36:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.0.36:compile
[INFO] |  |  |  +- org.apache.tomcat.embed:tomcat-embed-logging-juli:jar:8.0.36:compile
[INFO] |  |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.0.36:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-validation:jar:1.3.7.RELEASE:compile
[INFO] |  |  |  \- org.hibernate:hibernate-validator:jar:5.2.4.Final:compile
[INFO] |  |  |     +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  |     +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] |  |  |     \- com.fasterxml:classmate:jar:1.1.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.6.7:compile
[INFO] |  |  +- org.springframework:spring-web:jar:4.2.7.RELEASE:compile
[INFO] |  |  |  +- org.springframework:spring-aop:jar:4.2.7.RELEASE:compile
[INFO] |  |  |  +- org.springframework:spring-beans:jar:4.2.7.RELEASE:compile
[INFO] |  |  |  \- org.springframework:spring-context:jar:4.2.7.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-webmvc:jar:4.2.7.RELEASE:compile
[INFO] |  |     \- org.springframework:spring-expression:jar:4.2.7.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-actuator:jar:1.3.7.RELEASE:compile
[INFO] |  |  \- org.springframework.boot:spring-boot-actuator:jar:1.3.7.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-hystrix:jar:1.1.5.RELEASE:compile
[INFO] |  |  +- com.netflix.hystrix:hystrix-core:jar:1.5.3:compile
[INFO] |  |  |  \- org.hdrhistogram:HdrHistogram:jar:2.1.7:compile
[INFO] |  |  +- com.netflix.hystrix:hystrix-metrics-event-stream:jar:1.5.3:compile
[INFO] |  |  \- com.netflix.hystrix:hystrix-javanica:jar:1.5.3:compile
[INFO] |  |     +- org.aspectj:aspectjweaver:jar:1.8.9:compile
[INFO] |  |     +- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |     +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] |  |     \- org.ow2.asm:asm:jar:5.0.4:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-ribbon:jar:1.1.5.RELEASE:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon:jar:2.2.0:compile
[INFO] |  |  |  +- com.netflix.ribbon:ribbon-transport:jar:2.2.0:runtime
[INFO] |  |  |  |  +- io.reactivex:rxnetty-contexts:jar:0.4.9:runtime
[INFO] |  |  |  |  \- io.reactivex:rxnetty-servo:jar:0.4.9:runtime
[INFO] |  |  |  +- javax.inject:javax.inject:jar:1:runtime
[INFO] |  |  |  \- io.reactivex:rxnetty:jar:0.4.9:runtime
[INFO] |  |  |     +- io.netty:netty-codec-http:jar:4.0.27.Final:runtime
[INFO] |  |  |     |  +- io.netty:netty-codec:jar:4.0.27.Final:runtime
[INFO] |  |  |     |  \- io.netty:netty-handler:jar:4.0.27.Final:runtime
[INFO] |  |  |     \- io.netty:netty-transport-native-epoll:jar:4.0.27.Final:runtime
[INFO] |  |  |        +- io.netty:netty-common:jar:4.0.27.Final:runtime
[INFO] |  |  |        +- io.netty:netty-buffer:jar:4.0.27.Final:runtime
[INFO] |  |  |        \- io.netty:netty-transport:jar:4.0.27.Final:runtime
[INFO] |  |  +- com.netflix.ribbon:ribbon-core:jar:2.2.0:compile
[INFO] |  |  |  \- commons-lang:commons-lang:jar:2.6:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon-httpclient:jar:2.2.0:compile
[INFO] |  |  +- com.netflix.ribbon:ribbon-loadbalancer:jar:2.2.0:compile
[INFO] |  |  |  \- com.netflix.netflix-commons:netflix-statistics:jar:0.1.1:runtime
[INFO] |  |  \- io.reactivex:rxjava:jar:1.1.5:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-archaius:jar:1.1.5.RELEASE:compile
[INFO] |  |  +- com.netflix.archaius:archaius-core:jar:0.7.4:compile
[INFO] |  |  |  \- com.google.code.findbugs:jsr305:jar:3.0.1:runtime
[INFO] |  |  +- commons-configuration:commons-configuration:jar:1.8:compile
[INFO] |  |  |  \- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.7:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-core:jar:2.6.7:compile
[INFO] |  |  \- com.google.guava:guava:jar:18.0:compile
[INFO] |  \- com.netflix.zuul:zuul-core:jar:1.1.0:compile
[INFO] |     +- commons-io:commons-io:jar:2.4:runtime
[INFO] |     +- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] |     +- com.netflix.servo:servo-core:jar:0.10.1:runtime
[INFO] |     |  \- com.netflix.servo:servo-internal:jar:0.10.1:runtime
[INFO] |     \- com.netflix.netflix-commons:netflix-commons-util:jar:0.1.1:runtime
[INFO] \- org.springframework.cloud:spring-cloud-starter-eureka:jar:1.1.5.RELEASE:compile
[INFO]    +- org.springframework.cloud:spring-cloud-netflix-core:jar:1.1.5.RELEASE:compile
[INFO]    |  +- org.springframework.boot:spring-boot:jar:1.3.7.RELEASE:compile
[INFO]    |  \- org.springframework.boot:spring-boot-autoconfigure:jar:1.3.7.RELEASE:compile
[INFO]    +- org.springframework.cloud:spring-cloud-netflix-eureka-client:jar:1.1.5.RELEASE:compile
[INFO]    +- com.netflix.eureka:eureka-client:jar:1.4.10:compile
[INFO]    |  +- org.codehaus.jettison:jettison:jar:1.3.7:runtime
[INFO]    |  |  \- stax:stax-api:jar:1.0.1:runtime
[INFO]    |  +- com.netflix.netflix-commons:netflix-eventbus:jar:0.3.0:runtime
[INFO]    |  +- javax.ws.rs:jsr311-api:jar:1.1.1:runtime
[INFO]    |  +- com.sun.jersey:jersey-core:jar:1.19.1:runtime
[INFO]    |  +- com.sun.jersey:jersey-client:jar:1.19.1:runtime
[INFO]    |  +- com.sun.jersey.contribs:jersey-apache-client4:jar:1.19.1:runtime
[INFO]    |  +- org.apache.httpcomponents:httpclient:jar:4.5.2:runtime
[INFO]    |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.5:runtime
[INFO]    |  |  \- commons-codec:commons-codec:jar:1.9:runtime
[INFO]    |  +- com.google.inject:guice:jar:4.0:runtime
[INFO]    |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO]    |  \- com.netflix.governator:governator-api:jar:1.12.10:runtime
[INFO]    +- com.netflix.eureka:eureka-core:jar:1.4.10:compile
[INFO]    |  +- com.amazonaws:aws-java-sdk-core:jar:1.11.18:runtime
[INFO]    |  |  \- com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:jar:2.6.6:runtime
[INFO]    |  +- com.amazonaws:aws-java-sdk-ec2:jar:1.11.18:runtime
[INFO]    |  +- com.amazonaws:aws-java-sdk-autoscaling:jar:1.11.18:runtime
[INFO]    |  +- com.amazonaws:aws-java-sdk-sts:jar:1.11.18:runtime
[INFO]    |  +- com.amazonaws:aws-java-sdk-route53:jar:1.11.18:runtime
[INFO]    |  +- com.netflix.governator:governator:jar:1.12.10:runtime
[INFO]    |  |  \- com.netflix.governator:governator-core:jar:1.12.10:runtime
[INFO]    |  \- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime
[INFO]    |     +- javax.xml.stream:stax-api:jar:1.0-2:runtime
[INFO]    |     \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime
[INFO]    +- com.netflix.ribbon:ribbon-eureka:jar:2.2.0:compile
[INFO]    \- com.thoughtworks.xstream:xstream:jar:1.4.2:compile
[INFO]       +- xmlpull:xmlpull:jar:1.1.3.1:compile
[INFO]       \- xpp3:xpp3_min:jar:1.1.4c:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.541 s
[INFO] Finished at: 2018-08-05T11:12:50+08:00
[INFO] ------------------------------------------------------------------------

常见快捷方式有哪些

1 用得最多的快捷键

Ctrl + Shift + F    根据输入内容查找,范围为整个项目

Alt + Enter    根据光标所在问题,提供快速修复选择

Ctrl + Shift + /    代码块注释

Ctrl + / 代码注释

Ctrl + Alt + 左方向键    退回到上一个操作的位置

Ctrl + Alt + 右方向键    前进到下一个操作的位置

Ctrl + Alt + L    格式化代码

Shift + Shift  各种查找

Shift + Enter 跳到下一行的行首

2 快捷键大全参考

IntelliJ IDEA 常用快捷键介绍_SmileorSilence的博客-CSDN博客_intellij 常用快捷键

字体怎样设置

标注1:显示等宽字体

标注2:设置字体大小

标注3:设置字体类型

标注4:代码编辑区字体设置位置

标注5:字体设置后的效果

项目编码在哪里设置

怎样设置Maven

中文乱码问题

如果还没法解决,用notepadd++打开,将里面的含中文的代码拷到IDEA的编辑区。

Java 非法字符\ufeff 报错解决方法

1 问题现象

2 解决方法

1 右下角选择more中的utf-8

2 选择convert

怎样调整应用程序启动时候所占内存大小

调整VM options参数,这里调整为64m

如果编译出现找不类的情况

com.itedu365.best6001.BeforeTest

错误: 找不到或无法加载主类 com.itedu365.best6001.BeforeTest


Process finished with exit code 1

解决方法:

1 参考:使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题分析_suwenlai的博客-CSDN博客

2

Spring Assistant插件介绍

1 作用

它主要用来创建Spring Boot

2 安装方法

安装完后,要重启IDEA

3 使用方法

Lombok插件是什么

1 作用

它用来帮助开发人员简化冗长的Java代码,尤其是对POJO非常有用。可以通过Lombok提供的注解,很方便的实现简化代码的目的。

2 安装方法

安装完成后,需要重新启动IDEA

智能提示代码功能

1 作用

可以做到基于上下文环境智能匹配使用。

2 快捷键

Ctrl+Shift+Space

3 使用效果

快捷键在哪里

自动提示参数

1 作用

如果使用的方法参数过多,则只要将光标放置在需要放入参数的位置,等待一会,IDEA就会进行智能提示。如果不想等待,则可以在方法内使用Ctrl+P快捷键。

2 使用效果

实现自动转义

1 第一步:按下Alt+Enter

2 第二步:按Enter键,出现如下截图

3 第三步:搜索到JSON,然后按下Enter

4 第四步:再次按下Alt+Enter

5 第五步:输入元素串后,可以动态输出转义后的串。

什么是Live Template

1 作用

动态代码模板,对常用代码定义代码块,能提高开发效率。

2 举例

public static void test(){
   // sout  快速生成
   System.out.println();
   // soutm  快速生成
   System.out.println("HelloWorldApplication.test");
   //fori  快速生成
   for (int i = 0; i < ; i++) {
      
   }
   //ifn  快速生成
   if ( == null) {
      
   }
}
//psfs  快速生成
public static final String

3 自定义Livd Template

a 示例

b 方法

怎样设置文件头的注释信息

1 模板代码

/**
* Copyright (C), 2020-${YEAR}, XXX有限公司
* FileName: ${NAME}
* Author:   cakin
* Date:     ${DATE} {TIME}
* Description: ${DESCRIPTION}
* History:
* <author>          <time>          <version>          <desc>
* 作者姓名           修改时间           版本号              描述
*/

2 设置位置

怎样全局设置JDK

怎样全局设置Maven

第1步

第2步

怎样给IDEA增加依赖

1【File】->【Project Structure】->【Modules】->【Dependencies】,然后单击“+”号,选择【 JARs or directories...】

IDEA对接码云操作

1 创建本地仓库方法

菜单>【CVS】>【Import into version control】>【Create Git Repository】

2 创建远程仓库方法

项目右键>【Git】>【Repository】>【Remotes...】,在打开的【Git Remotes】窗口中添加码云的远程仓库。码云的远程仓库地址可以在码云仓库内找到。

3 新增文件提交到本地仓库或直接提交到码云

下面是需要提交的代码

首先项目右键【Git】>【Add】,然后项目右键【Git】>【Commit Directory】,在打开的窗口中选择要上传到本地仓库的代码,并添加注释后提交到本地仓库内。

4 从本地仓提交代码到码云

项目右键【Git】>【Repository】>【Push...】

在打开的【Push commits】内可以看到已提交到本地仓库的提交信息。点击【Push】按钮将本地仓库的代码上传到码云上

上传成功后就可以在码云上看到了

4 文件更新后上传到码云

在码云上看到修改成功了!

5 更新本地代码为最新

先在码云上修改下代码

然后在本地更新为最新的代码

查看本地代码,果然更新了

6 相关问题

如果上传时出现:Push rejected: Push to origin/master was rejected  错误。打开你要上传代码的文件夹右键git Bash Here然后直接运行下面的命令解决问题。

git pull
git pull origin master
git pull origin master –allow-unrelated-histories

IDEA打开码云上的代码

1 选择【Check out from Version Contrl】>【git】

2 选择码云对应仓库和本地目录

3 点击【Clone】>【Yes】>【Next】

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
以下是一些高效实用idea技巧: 1. 调整窗口字体显示大小:可以根据个人喜好调整IDEA的字体大小,以提高阅读体验和舒适度。 2. 字体设置:可以根据个人喜好选择合适的字体,以提高代码的可读性。 3. 自动导包和删除无用包:IDEA提供了自动导入和删除无用包的功能,可以帮助我们更快地编写代码和保持代码的整洁。 4. 显示方法分割线:可以在代码编辑器中设置显示方法之间的分割线,以便更清晰地区分不同的方法。 5. 常用快捷键:熟悉并使用常用的快捷键可以提高编码效率,例如Ctrl + Space可以自动补全代码,Ctrl + Alt + L可以格式化代码等。 除了以上技巧,还有一些必备的插件可以提高开发效率,例如: - Tabnine:基于AI的代码提示插件,可以根据上下文提供智能的代码补全建议。 - Rainbow Brackets:彩虹括号插件,可以帮助我们更清晰地区分不同的括号。 - Material Theme UI:颜值插件,可以为IDEA提供漂亮的主题和界面。 - Atom Material Icons:图标插件,可以为IDEA的文件和目录提供美观的图标。 - Translation翻译插件:可以在IDEA中直接进行文本的翻译,方便查阅和理解外文文档。 - MybatisX快速开发插件:可以辅助快速开发MyBatis项目,提高开发效率。 - CodeGlance代码地图:可以在编辑器侧边栏显示代码的缩略图,方便快速导航和查看代码结构。 希望以上技巧和插件能够帮助您更高效地使用IDEA进行开发。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值