1. 程式人生 > 實用技巧 >mac上 idea 啟動Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines...

mac上 idea 啟動Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines...

在用idea軟體run的時候顯示:

objc[23229]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java (0x10af154c0) and /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10afd04e0). One of the two will be used. Which one is undefined.

解決辦法:

1.點選IntelliJ IDEA最上面選單的”Help”下的“Edit Custom Properties”,沒有這個properties檔案的話,IntelliJ IDEA會提示建立;
2.在檔案中加上
idea.no.launcher=true
3.重啟IntelliJ IDEA

原因分析:

You can find all the details here:

IDEA-170117“objc: Class JavaLaunchHelper is implemented in both …” warning in Run consoles
It’s theold bug in Javaon Mac thatgot triggered by the Java Agentbeing used by the IDE when starting the app. This message is harmless and is safe to ignore. Oracle developer’s comment:

The message is benign, there is no negative impact from 
this problem since both copies of that class are identical (compiled from the exact same source). It is purely a cosmetic issue. Theproblem is fixedin Java 9 and inJava 8 update 152. If it annoys you or affects your apps in any way, the workaround for IntelliJ IDEA is to disableidea_rtlauncher agent by addingidea.no.launcher=true
intoidea.properties(Help|Edit Custom Properties...).

Mac上面Java的一個老Bug了,會在那些使用了Java Agent的IDE上執行應用時觸發,但這個Error對程式是無影響的,可以無視