Mac os x installation and configuration IDEAL JDK and Maven

This article is configured jdk and operations maven IDEAL document under the premise has been installed.

1, download and configure the JDK and Maven

Mac download and configure the JDK methods:

See Mac install JDK and JMeter5 - install JDK

Mac download and configure Maven method:

Open Maven's official website download page: https://maven.apache.org/download.cgi

Download: the Apache-Maven-3.6.1-bin.tar.gz

Extracting: the installation package downloaded into a directory, such as: / Users / xxx / Documents / maven

Configuration environment variable:

# Open terminel enter the following command

$ Vim ~ / .bash_profile # open the file .bash_profile

export M2_HOME=/Users/xxx/Documents/maven/apache-maven-3.6.1

export PATH=$PATH:$M2_HOME/bin

After adding the save and exit, execute the following command to validate the configuration:

$source ~/.bash_profile

$ Mvn -v # view the configuration is in effect, saw Apache Maven 3.6.1 means that the configuration was successful.

 

2, the configuration of the JDK and Maven in IDEAL

IDEAL JDK configuration is simple, the operation can be as follows:

Open IDEAL, choose File- the top navigation bar> New-> Project ...

Click on Java, see the Project SDK there jdk installed version, click Next

 

Select the java sample Java Hello World

 

public class Main {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

右键点击Run ‘Main’,查看控制台数据打印。打印出Hello World!即可。

 

IDEAL中配置Maven:

进入解压的maven目录,conf->settings.xml,在这个文件中选一个本地的目录作为Maven本地仓库配置本地仓库路径。这样,Maven工具就算安装并配置好了。

 

在Intellij IDEA中设置Maven:

打开IDEA 选择File->Other Settings->Default Settings

 

搜索框输入maven,在

 

还可以勾选一些选项,进入Importing

 

 

 

------------------------------------------------------Tanwheey-------------------------------------------------------------------------

爱生活,爱工作。

 

Guess you like

Origin www.cnblogs.com/Tanwheey/p/python3.html