Mac环境下安装MAT分析内存快照的踩坑过程

it2025-02-03  10

前言

点赞在看,养成习惯。

点赞收藏,人生辉煌。

点击关注【微信搜索公众号:编程背锅侠】,第一时间获得最新文章。

1、下载压缩文件并解压出mat.app

1.1、官方下载链接https://www.eclipse.org/mat/downloads.php

2、将解压的mat.app移动到/Applications

MacBook-Pro  ~/Applications $ mv /Users/fenke/Downloads/mat.app .

3、直接运行报错并解决

3.1、错误提示

如果直接点击mat应用,会启动失败,并弹窗提示我们去查看日志文件 .eclipse/1005214708_macosx_cocoa_x86_64/configuration/1578452593396.log

3.2、异常信息

java.lang.IllegalStateException: The platform metadata area could not be written: /private/var/folders/_h/mmd26ldd751g7gnx6wjfghzw0000gn/T/AppTranslocation/47640E19-535C-4C8D-84DA-8D0DDA56BFD4/d/mat.app/Contents/MacOS/workspace/.metadata. By default the platform writes its contentunder the current working directory when the platform is launched. Use the -data parameter to specify a different content area for the platform.

3.3、异常修复

3.3.1、创建工作空间

MacBook-Pro $ cd /Applications/mat.app/Contents/MacOS MacBook-Pro ~/Applications/mat.app/Contents/MacOS $ mkdir workspace

3.3.2、修改配置信息

MacBook-Pro $ cd /Applications/mat.app/Contents MacBook-Pro  ~/Applications/mat.app/Contents $ vi Info.plist

3.3.4、找到包围的部分配置

<array> <string>-vm</string> <string>/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java</string> <string>-data</string> <string>/Users/fenke/Applications/mat.app/Contents/MacOS/workspace</string> <string>-keyring</string> <string>~/.eclipse_keyring</string> </array>

-vm 对应的是你的虚拟机的路径 -data 对应的是我们刚刚创建的工作空间的路径 -keyring不用修改

3.3.5、截图

4、结束

保存以后,再次运行这个mat.app就不会报错了,就会看到一下这个页面。证明修改成功。

谢谢点赞
创作不易, 非常欢迎大家的点赞、评论和关注(^_−)☆你的点赞、评论以及关注是对我最大的支持和鼓励是我继续创作高质量博客的动力 !!!
最新回复(0)