在使用Idea启动main方法时,提示

Class JavaLaunchHelper is implemented in both Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java

在stackoverflow上找到了解决方法:https://stackoverflow.com/questions/43003012/class-javalaunchhelper-is-implemented-in-two-places

原因:

It's the old bug in Java on Mac that got triggered by the Java Agent being used by the IDE when starting the app. This message is harmless and is safe to ignore.

解决方法:

1、使用高版本的JDK。这个问题已经在Java 9 和 8 update 152 中修复。

2、修改Idea配置。在idea.properties中添加idea.no.launcher=true


感谢大家的阅读, 如有疑问可以加我微信