1. 程式人生 > >Class JavaLaunchHelper is implemented in two places

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.