解决MAC IDEA 中libinstrument.dylib (0x1053dc4e0). One of the two will be used. Which one is undefined

在MAC上使用IDEA运行Java应用时出现警告,指出Class JavaLaunchHelper在两个路径中都有实现:/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java和/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/libinstrument.dylib。警告表示IDEA会使用其中一个,但未明确指出是哪个。该问题的根源是系统存在两个类路径。解决方法是在IDEA的自定义属性设置中添加一行配置,重启IDEA后警告消失。如果问题仍未解决,需检查JDK环境配置是否正确。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题描述

objc[16231]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java (0x10535c4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1053dc4e0). One of the two will be used. Which one is undefined.

Root cause

When starting a java application, IDEA finds two classpaths in current lcoal environment, as a result, it selects one of them and raise a waring saying above info.

解决方法

idea -》 help -》Edit Custom Protrities
在新建的文件里面写入:

# custom IntelliJ IDEA properties
idea_rt
idea.no.launcher=true

重新启动后就没有了。

后续

如果不行,请确保你的JDK环境配置正确

zozo@B-42WUMD6M-2307 goc-project % cat ~/.bash_profile
export M3_HOME=/Users/liuzozo/work/apache-maven-3.6.1

JAVA_HOME=/Library/Ja
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序哥聊面试

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值