• Java JDK和IntelliJ IDEA 配置及安装


    序言

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

    idea 软件

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

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

    版本

    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.0

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

    jdk环境变量

    Path:      C:Program FilesJavajdk1.8.0_162in
    CLASSPATH:   C:Program FilesJavajdk1.8.0_162lib
    JAVA_HOME   C:Program FilesJavajdk1.8.0_162

    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 filesgitcmdgit.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 去掉

    总结

    用着更新着吧

  • 相关阅读:
    iOS开发UI篇—懒加载
    iOS开发UI篇—transframe属性(形变)
    iOS开发UI基础—手写控件,frame,center和bounds属性
    iOS开发UI篇—Button基础
    【iOS开发】多线程下NSOperation、NSBlockOperation、NSInvocationOperation、NSOperationQueue的使用
    【iOS开发】NSOperation简单介绍
    【iOS开发】创建单例的两种方法
    【iOS开发】iOS对UIViewController生命周期和属性方法的解析
    【iOS开发】UIView之userInteractionEnabled属性介绍
    【iOS开发】IOS界面开发使用viewWithTag:(int)findTag方法获取界面元素
  • 原文地址:https://www.cnblogs.com/knowledgesea/p/11158412.html
Copyright © 2020-2023  润新知