MacM1芯片安装java开发环境(idea+jdk)

MacM1芯片安装java开发环境(idea+jdk)

说在前面

校招刚入职的公司发的是新款的M1芯片的mac,和网上的主流软件教程都不兼容,这可难倒了我,因此这里总结一下java开发环境的安装。

安装JDK

m1芯片使用的是arm架构,而目前Oracle还没有推出适配Mac的arm架构的jdk,所以想安装Oracle的jdk只能安装x86版本。zulu已经推出了适配Mac arm架构openjdk版本,m1使用arm架构的jdk版本,最明显的效果就是会很大程度提升Java源代码的编译速度。我看过网上有人拿Macbook air m1版本做编译速度的测试,编译要比 MacBook pro i9版本还要快。所以,如果你是m1芯片的mac,可以安装zulu的arm架构的openjdk,别安装错了。

进入azul官网选择所需要的版本https://www.azul.com/downloads/?package=jdk

我这里选择的JDK版本是8u332b09Azul Zulu: 8.62.0.19

一直下一步,安装结束后终端输入,有输出版本信息即为安装成功。

java -version

安装IDEA

根据自己的电脑型号版本下载,M1芯片一定要选ARM原生M1https://www.123pan.com/s/c6cA-NJkw3

  1. JetBrains官网 下载安装你需要的 IDE,如果下载慢可以在 macwk 搜索 jetbrains。

  2. 下载 Jetbrains.zip,下载后解压,得到 fineagent.jar,将该文件复制到 /Users/你的用户名/ 文件夹下

  3. 打开访达,点击左侧的 应用程序 找到 IntelliJ IDEA,在IntelliJ IDEA 图标上右键,点击 显示包内容

  4. 进入 Contents 目录,再进入 bin 目录,使用文本编辑器打开 idea.vmoptions 文件

  5. 在最后面添加 -javaagent:/Users/你的用户名/fineagent.jar,记得修改一下你的用户名。

  6. 运行 IntelliJ IDEA, 选择 Activate idea,再点击 Activation Code

  7. 复制下面的的激活码粘贴到激活窗口的输入框中,点击 Activate。可以用到 2099 年!

5AYV1D1RE5-eyJsaWNlbnNlSWQiOiI1QVlWMUQxUkU1IiwibGljZW5zZWVOYW1lIjoiaHR0cHM6Ly93d3cuaml3ZWljaGVuZ3podS5jb20iLCJhc3NpZ25lZU5hbWUiOiIiLCJhc3NpZ25lZUVtYWlsIjoiIiwibGljZW5zZVJlc3RyaWN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CASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMK3eyr0+Oys/TwcQO+qYaXWGBmXcEP4fR0bHHzZd/4WNGltXhecM80OWthA38BQRYAJBCKz/dSkO2Kj1H2y+7KB5cIaOiJEyTESfTSgzQdot6laRBU8oxy9mmagI46M8zEEmplPybY4YJj4HOwZiBsMQEMxoTgMDLpuHX6uASoVhSj6koB55lOj4wEgsQBeAMWTAXmTl88ixE179J8aBUkBGpL8w/tZzl9BJXZNF15gPfkS58rw8cdPzXLS0Yym37A2/KKFhfHzJc5KhbaxqYzmkAfTMqPsIqCQ1lQUAqfiPn2gN2I1Z3/cQuEW27M55fXVr2DduQe5DWzYJs85L50CAwEAAaOBmTCBljAJBgNVHRMEAjAAMB0GA1UdDgQWBBQk2hEilvWFQcCTR+gxI0z0wIQC/zBIBgNVHSMEQTA/gBSjnrZIZ0ISNkG9beC5tKBSi5fxs6EcpBowGDEWMBQGA1UEAwwNSmV0UHJvZmlsZSBDQYIJANJssYOyg3nhMBMGA1UdJQQMMAoGCCsGAQUFBwMBMAsGA1UdDwQEAwIFoDANBgkqhkiG9w0BAQsFAAOCAQEAsCQBjO5wttco/Z5cj/o4GBrku8UtBBBVFq4xsBanshTHm4deVxcTvta4aScV0TPKcaLqGqWx8A9v8XXO8dBbCuyXvWZteZ/C2Covg1xXiM99lz7VxqpjVmLdKanZn5u0gQSiYJdcfF+TdbmEIeSOnN/kLXNq2hXdJQK2zk2J25UZqu5EibRtTbdOzw6ZcfwJ8uOntXfsmAhnNICP3Wf/4wR/mwB0Ka4S+JA3IbF5MUmUZ/fjUaFarnin70us+Vxf/sZUi7u67wilvwVV0NAqDpthHUV0NRc4q+yOr2Dt/uCHdy4XRXLJfAv/z9/xBwNZZALNz3EtQL6IeIWWJByl3g==

尽情享用吧!

public class hello {
 public static void main(String[] args) {
 System.out.println("hello word");
 }
}

打开idea愉快的写hello word吧!

你可能感兴趣的:(MacM1芯片安装java开发环境(idea+jdk))