Java JDK和IntelliJ IDEA 配置及安装

序言

初学java,idea走一波先。安装完成,配置配置项.java

idea 软件

官方下载地址:https://www.jetbrains.com/idea/download/#section=windows git

我盘里面的,时间久啦就老啦。忽略。windows

版本intellij-idea

IntelliJ IDEA 2019.1.3 (Ultimate Edition)
Build #IU-191.7479.19, built on May 28, 2019
Licensed to jetbrains js
Subscription is active until November 27, 2019
JRE: 1.8.0_202-release-1483-b58 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0app

连接:https://pan.baidu.com/s/1Oy1Pr_XrMybEg8WmYtLjaA
提取码:7nvg ide

jdk环境变量

Path:      C:\Program Files\Java\jdk1.8.0_162\bin
CLASSPATH:   C:\Program Files\Java\jdk1.8.0_162\lib
JAVA_HOME   C:\Program Files\Java\jdk1.8.0_162svn

Code templates

1.idea设置:File->Settings->Editor->File and Code Templates工具

选中Includes标签:选中File Header,修改成 开发工具

/**
* @author ${USER} 
* @date ${DATE} ${TIME}
*/ 字体

修改Files,依次编辑Class,Interface,Enum等经常使用java类型,修改成

/*
* Copyright ${YEAR} tu.cn All right reserved. This software is the
* confidential and proprietary information of tu.cn ("Confidential
* Information"). You shall not disclose such Confidential Information and shall
* use it only in accordance with the terms of the license agreement you entered
* into with Tu.cn
*/
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#parse("File Header.java")
public class ${NAME} {
}

Code Formatter

1.2 idea下请先装Eclipse Code Formatter的插件, 设置: File->Settings->Other Settings->Eclipse Code Formatter->Eclipse Java Formatter config file->导入文件
1.3 idea若是遇到装不了插件的状况, 设置: File->Settings->Appearance&Behavior->System Settings->Updates->将Use secure connection勾选去掉

模板地址

连接:https://pan.baidu.com/s/1rvhj0oW_SM8xnIyuOhQ_oQ
提取码:f54k

取消大小写敏感

file->Settings->Editor->General->Code Complention->Match case 勾去掉

隐藏开发工具的配置目录 例如 .idea;.iml

file->Settings->Editor->File Types->ignore file and folders 结尾添加 .idea;*.iml

收起注释,让源码阅读更为清爽!

File -> Settings -> Editor -> General -> Code Folding -> Documentation comments 勾选。

快速打开/关闭全部文档注释

右键->Folding->Expand All/Collapse All

快速文档注释

alt+enter- >Add Javadoc

自动编译

敲击 Ctrl + Shift + Alt + / 而后双击Shift搜索进入Registry ,找到compiler.automake.allow.when.app.running ,而后勾选上。(运行期间自动编译设置)。

https://www.jianshu.com/p/f658fed35786

自动导包和智能移除 

File -> Settings -> Editor -> General ->Auto Import

1.add unambiguous imports on the fly //自动导入依赖

2.optimize imports on the fly(for current project) //优化导入和只能删除勿关依赖

使用 Alt + Enter 进行导入包.

Insert imports on paste:复制代码的时候,对于导入的包是否须要进行询问的一个选项。
         ASK(有须要导入的包名时会弹提示框,问你要不要导入)
         NONE(有须要导入的包名时不会弹提示框,也不会自动导入)
         ALL(有须要导入的包名时会自动导入,不会弹提示框)
Show import popup:当输入的类的声明没被导入时,会弹出一个选择的对话框
Optimize imports on fly:自动优化包导入,移除不须要的包
Add unambiguous imports on the fly:这个就是自动导入功能了,当你输入类名后声明就被自动导入了
Exclude from Import and Completion:这个其实就是你自定义import,能够不用关注,通常来讲你是用不上

版本控制

idea会自动识别,本身也看下对不对嘛。

file->version control->git

path to git executable : git.exe 绝对路径 c:\program files\git\cmd\git.exe

左侧项目显示类方法

内存使用量展现

file->setting->appearance & behaivier -> show memory indicator

悬浮提示

File-->Settings-->Editor-->General-->show quick documenttion on mouse move 勾选

有时候在看代码的时候,不清楚一个类具体是干什么的,就会点进去看这个类的注释,可是强大的IDEA是支持不用点进去就能够看到注释的以及类的相关信息的。可是须要手动打开

Ctrl+鼠标滚轴修改字体大小

File-->Settings-->Editor-->General-->change font size(Zoom) with Ctrl+Mouse Wheel 勾选

 

显示多行Tab

File-->Settings-->Editor-->General-->Editor tabs

1.去掉 show tabls in one row

2.tab limits 增长为20个。

显示行号,显示svn/git最近提交人

在编辑区直接操做,能看到每一行代码的最近一次修改人,以及提交记录信息。这样每行代码都有记录。能很快定位到谁动过代码,而后找到指定的人来解决问题。

查看文件的本地历史记录

鼠标选中文件,而后右键,在弹出的列表中选择Local History而后就能够看到文件的本地修改记录,即便没有版本控制工具也能够看到这些记录。 

全局JDK配置

File ->Other Settins -> Project Structure for New projects-> Project 

关闭Intellij IDEA自动更新

File->Settings->Appearance & Behavior->System Settings->Updates下取消Automatically check updates for勾选 

文件编码设置

File->Settings->Editor->File Encodings

推荐设置:

Global Encoding:UTF-8
Projectt Encoding:UTF-8
Default encoding for properties files:UTF-8
勾选上Transparent native-to-ascii conversion
Transparent native-to-ascii conversion属性主要用于转换ascii,否则Properties文件的中文会被转码,IntelliJ IDEA除了支持对整个Project设置编码以外,还支持对目录、文件进行编码设置。若是你要对目录进行编码设置的话,可能会出现须要Convert编码的弹出操做选择,强烈建议在转换以前作好文件备份,否则可能出现转换过程变成乱码,没法还原。对单独文件的编码修改还能够点击右下角的编码设置区,若是代码内容中包含中文,则会弹出演示中的操做选择,Reload 表示使用新编码从新加载,新编码不会保存到文件中,从新打开此文件,旧编码是什么依旧仍是什么,Convert 表示使用新编码进行转换,新编码会保存到文件中,从新打开此文件,新编码是什么则是什么。

提示选中补全代码(Enter/空格,逗号等)

File->Settings->Editor->General-->Code Comepletion -> insert selected suggestion by pressing space,dot,or other context-dependent keys 勾选上。

方法未引用检查去掉

Setting-->editor-->inspections-->unused declaration-->methods 去掉

总结

用着更新着吧

相关文章
相关标签/搜索