JavaLaunchHelper 类在两个地方实现
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43003012/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Class JavaLaunchHelper is implemented in two places
提问by Ess
Today I upgraded my Intellij Idea on macOS Sierra, and now, when I run apps in console I have this error:
今天我在 macOS Sierra 上升级了我的 Intellij Idea,现在,当我在控制台中运行应用程序时,出现以下错误:
objc[3648]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java (0x10d19c4c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10ea194e0). One of the two will be used. Which one is undefined.
objc[3648]:JavaLaunchHelper 类在 /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java (0x10d19c4c0) 和 /Library/Java/JavaVirtualMachines/jdk1/jdk1.8.0 中实现。目录/主页/jre/lib/libinstrument.dylib (0x10ea194e0)。将使用两者之一。哪个是不确定的。
采纳答案by CrazyCoder
You can find all the details here:
您可以在此处找到所有详细信息:
- IDEA-170117"objc: Class JavaLaunchHelper is implemented in both ..." warning in Run consoles
- IDEA-170117“objc:JavaLaunchHelper 类在两者中都实现了......”运行控制台中的警告
It's the old bug in Javaon Mac that got 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:
这是Mac 上Java 中的旧错误,由 IDE 在启动应用程序时使用的 Java 代理触发。此消息是无害的,可以安全地忽略。Oracle 开发人员的评论:
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 fixedin Java 9and in Java 8 update 152.
该问题已在Java 9和Java 8 更新 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.
如果它让您烦恼或以任何方式影响您的应用程序(它不应该),IntelliJ IDEA 的解决方法是idea_rt
通过添加idea.no.launcher=true
到idea.properties
( Help
| Edit Custom Properties...
)来禁用启动器代理。该解决方法将在下次重新启动 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.
不过,我不建议禁用 IntelliJ IDEA 启动器代理。它用于正常关闭(退出按钮)、线程转储、解决命令行过长超出操作系统限制的问题等功能。为了隐藏无害消息而失去这些功能可能不值得,但它是由你决定。
回答by Danny Guo
This happened to me when I installed Intellij IDEA 2017, go to menu Preferences -> Build, Execution, Deployment -> Debugger and disable the option: "Force Classic VM for JDK 1.3.x and earlier". This works to me.
当我安装 Intellij IDEA 2017 时,这发生在我身上,转到菜单 Preferences -> Build, Execution, Deployment -> Debugger 并禁用选项:“Force Classic VM for JDK 1.3.x 及更早版本”。这对我有用。
回答by lnarasimhan
I am using Intellij Idea 2017 and I got into the same problem. What solved the problem for me was to simply
我正在使用 Intellij Idea 2017,但遇到了同样的问题。对我来说解决问题的方法很简单
- close the project in intelliJ
- File -> New -> project from existing resources
- use Import from external model (if any)
- open the project again.
- 在 IntelliJ 中关闭项目
- 文件 -> 新建 -> 来自现有资源的项目
- 使用从外部模型导入(如果有)
- 再次打开项目。
回答by Q.Lee
Same error, I upgrade my Junit
and resolve it
同样的错误,我升级Junit
并解决它
org.junit.jupiter:junit-jupiter-api:5.0.0-M6
to
到
org.junit.jupiter:junit-jupiter-api:5.0.0
回答by oldratlee
Since “this message is harmless”(see the @CrazyCoder's answer), a simpleand safeworkaround is that you can fold this buzzing message in console by IntelliJ IDEA settings:
由于“此消息无害”(请参阅@CrazyCoder 的回答),一个简单而安全的解决方法是您可以通过 IntelliJ IDEA 设置在控制台中折叠此嗡嗡声:
- 【Preferences】- 【Editor】-【General】-【Console】- 【Fold console lines that contain】
Of course, you can use 【Find Action...】(cmd+shift+A
on mac) and typeFold console lines that contain
so as to navigate more effectively. - add
Class JavaLaunchHelper is implemented in both
- 【Preferences】- 【Editor】-【General】-【Console】- 【Fold console lines that contains】
当然,您可以使用【Find Action...】(cmd+shift+A
在mac上)并输入Fold console lines that contain
以便更有效地导航。 - 添加
Class JavaLaunchHelper is implemented in both
On my computer, It turns out: (LGTM :b )
在我的电脑上,结果是:(LGTM :b)
And you can unfold the message to check it again:
您可以展开消息再次检查:
PS:
PS:
As of October 2017, this issue is now resolved in jdk1.9/jdk1.8.152/jdk1.7.161
for more info, see the @muttonUp's answer)
截至 2017 年 10 月,此问题现已在 jdk1.9/jdk1.8.152/jdk1.7.161 中得到解决,
了解更多信息,请参阅@muttonUp 的回答)
回答by gasabr
I have found the other workaround: to exclude libinstrument.dylib
from project path. To do so, go to the Preferences-> Build, Execution and Deployment-> Compiler-> Excludes-> +and here add file by the path in error message.
我找到了另一种解决方法:libinstrument.dylib
从项目路径中排除。为此,请转到Preferences-> Build, Execution and Deployment-> Compiler-> Excludes-> +并在此处按错误消息中的路径添加文件。
回答by Allison
This was an issue for me years ago and I'd previously fixed it in Eclipse by excluding 1.7 from my projects, but it became an issue again for IntelliJ, which I recently installed. I fixed it by:
这对我来说是多年前的一个问题,我以前通过从我的项目中排除 1.7 来在 Eclipse 中修复它,但它再次成为我最近安装的 IntelliJ 的问题。我通过以下方式修复它:
Uninstalling the JDK:
cd /Library/Java/JavaVirtualMachines sudo rm -rf jdk1.8.0_45.jdk
(I had
jdk1.8.0_45.jdk
installed; obviously you should uninstall whichever java version is listed in that folder. The offending files are located in that folder and should be deleted.)- Downloading and installing JDK 9.
卸载JDK:
cd /Library/Java/JavaVirtualMachines sudo rm -rf jdk1.8.0_45.jdk
(我已经
jdk1.8.0_45.jdk
安装了;显然您应该卸载该文件夹中列出的任何 Java 版本。有问题的文件位于该文件夹中,应该删除。)- 下载并安装 JDK 9。
Note that the next time you create a new project, or open an existing project, you will need to set the project SDK to point to the new JDK install. You also may still see this bug or have it creep back if you have JDK 1.7 installed in your JavaVirtualMachines folder (which is what I believe happened to me).
请注意,下次创建新项目或打开现有项目时,您需要将项目 SDK 设置为指向新的 JDK 安装。如果您在 JavaVirtualMachines 文件夹中安装了 JDK 1.7(我相信这就是发生在我身上的事情),您也可能仍然会看到此错误或使其恢复。