念念不忘
必有回响

解决idea控制台提示Class JavaLaunchHelper is implemented in two places

升级完IntelliJ IDEA2018.1之后,运行程序是会在控制台输入如下警告信息:

尽管是个警告信息,并且可以通过配置将其隐藏,但是恰好此时强迫症犯了,那就把它解决吧。于是通过简单的搜索,找到解决方案:

这个问题是Java的一个bug,由启动应用程序时由IDE使用的Java代理触发。 这个信息是无害的,可以安全地忽略。 Oracle开发人员的评论:

消息是良性的,这个问题没有负面影响,因为这个类的两个副本是相同的(从完全相同的源编译)。 这完全是一个美观问题。

解决方案就是升级JDK版本为Java 8 update 152 或者 Java 9 即可。我升级的是当前最新的Java_8_update_161。

原文如下:

You can find all the details here:

IDEA-170117 "objc: Class JavaLaunchHelper is implemented in both ..." warning in Run consoles
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. 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.

The problem is fixed in Java 9 and in Java 8 update 152.

If it annoys you or affects your apps in any way (it shouldn't), the workaround for IntelliJ IDEA is to disable idea_rt launcher agent by adding idea.no.launcher=true into idea.properties (Help | Edit Custom Properties...). The workaround will take effect on the next restart of the IDE.

I don't recommend disabling IntelliJ IDEA launcher agent, though. It's used for such features as graceful shutdown (Exit button), thread dumps, workarounds a problem with too long command line exceeding OS limits, etc. Losing these features just for the sake of hiding the harmless message is probably not worth it, but it's up to you.

参考链接:https://stackoverflow.com/questions/43003012/class-javalaunchhelper-is-implemented-in-two-places

 

赞(0) 打赏
未经允许不得转载:码农志 » 解决idea控制台提示Class JavaLaunchHelper is implemented in two places
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏