以ideaIU-2021.3.1
为例,安装步骤:
ideaIU-2021.3.1
D:\Program Files\JetBrains\IntelliJ IDEA 2021.3.1
success
的提示。至此,英文版安装好了。更多细节和汉化步骤参考:软件管家中的IDEA下载与安装。
其他安装教程参考:https://www.bilibili.com/video/BV1g4411k7UJ
方式1:可以下载与安装非idea自带的maven,可以参考该文1,或者参考该文2。
方式2:先使用idea自带的maven。
idea自带maven的本地路径参考:
D:\Program Files\JetBrains\IntelliJ IDEA 2021.3.1\plugins\maven\lib\maven3
。
可以在【Settings】-【Build, Execution, Deployment】-【Build Tools】-【Maven】中,找到(或重新指定)默认的maven配置文件地址:即【User settings file】的值(某settings.xml)。
无论方式1还是方式2,都有必要在maven配置文件中添加镜像(下载依赖会更快)。添加了镜像地址后的配置文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
</settings>
阿里云maven仓库关于maven配置的说明:https://developer.aliyun.com/mvn/guide。
似乎只需要保留这一个镜像地址就可以了,网上其他镜像地址有的已经访问不了了。
阿里云maven仓库搜索:
https://developer.aliyun.com/mvn/search
其他仓库搜索(国内也可访问):
https://mvnrepository.com/search?q=jts-core
https://central.sonatype.com/search?q=jts-core
org.apache.maven.archetypes:maven-archetype-quickstart
.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0modelVersion>
<groupId>org.examplegroupId>
<artifactId>demo-mavenartifactId>
<version>1.0-SNAPSHOTversion>
<dependencies>
<dependency>
<groupId>cn.hutoolgroupId>
<artifactId>hutool-allartifactId>
<version>5.8.16version>
dependency>
dependencies>
project>
import cn.hutool.core.util.RandomUtil;
public class Test {
public static void main(String[] args) {
int num = RandomUtil.randomInt();
System.out.println(num);
}
}
【Settings】-【Tools】-【Terminal】,将【shell path】(默认值powershell.exe
)修改为Git安装目录中的bin\bash.exe
路径,例如:D:\Program Files\Git\bin\bash.exe
。然后新建一个终端就是git bash了。
折叠代码:
折叠:ctrl+shift+ -
展开:ctrl+shift+ +
设置注释不顶格:
File–>Sttings–>Editor–>Code Style->Java
字体随鼠标滚动缩放
IDEA设置控制台显示在结尾,默认Scroll to End(问题描述参考):
在控制台面板处,取消勾选【Track Running Test】:
Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
在项目pom.xml中增加如下配置(指定编译时编码为UTF-8):
<properties>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
properties>