JavaLaunchHelper 类在... libinstrument.dylib 中实现。将使用两者之一。哪个是未定义的
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18794573/
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 both ... libinstrument.dylib. One of the two will be used. Which one is undefined
提问by ams
I upgraded to the latest Java 7u40on MacOS Xand started getting the following message on the console when launching my application using Eclipse. The app works fine but I would like to find out the cause of the problem and hopefully a fix for it.
我在MacOS X上升级到最新的Java 7u40,并在使用 Eclipse 启动我的应用程序时开始在控制台上收到以下消息。该应用程序运行良好,但我想找出问题的原因,并希望对其进行修复。
objc[10012]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_40.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
Does anyone know why this message is printed and how to fix it?
有谁知道为什么打印此消息以及如何修复它?
回答by Matthias Wenz
As other answers detail, this is a bug in the JDK (up to u45) which will be fixed in JDK7u60 - while this is not out yet, you may download the b01 from: https://jdk7.java.net/download.html
正如其他答案详细说明的那样,这是 JDK(最高 u45)中的一个错误,它将在 JDK7u60 中修复 - 虽然尚未发布,但您可以从以下位置下载 b01:https://jdk7.java.net/download 。 html
It's beta, but fixed that issue for me.
这是测试版,但为我解决了这个问题。
回答by gotoalberto
Install Java 7u21 from: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u21-oth-JPR
Set these variables:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home export PATH=$JAVA_HOME/bin:$PATH
Run your app and have fun :)
从以下位置安装 Java 7u21:http: //www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u21-oth-JPR
设置这些变量:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home export PATH=$JAVA_HOME/bin:$PATH
运行你的应用,玩得开心 :)
回答by Vinod Joshi
https://groups.google.com/forum/#!topic/google-appengine-stackoverflow/QZGJg2tlfA4
https://groups.google.com/forum/#!topic/google-appengine-stackoverflow/QZGJg2tlfA4
From what I've found online, this is a bugintroduced in JDK 1.7.0_45. I've read it will be fixed in the next release of Java, but it's not out yet. Supposedly, it was fixed in 1.7.0_60b01, but I can't find where to download it and 1.7.0_60b02 re-introduces the bug.
从我在网上找到的内容来看,这是JDK 1.7.0_45 中引入的一个错误。我已经读过它将在 Java 的下一个版本中修复,但它还没有发布。据说,它在 1.7.0_60b01 中得到了修复,但我找不到在哪里下载它,1.7.0_60b02 重新引入了该错误。
I managed to get around the problem by reverting back to JDK 1.7.0_25. Probably not the solution you wanted, but it's the only way I've been able to get it working. Don't forget add JDK 1.7.0_25 in Eclipse after installing the JDK.
我设法通过恢复到 JDK 1.7.0_25 来解决这个问题。可能不是您想要的解决方案,但这是我能够让它工作的唯一方法。安装 JDK 后不要忘记在 Eclipse 中添加 JDK 1.7.0_25。
Please DO NOT REPLY directly to this email but go to StackOverflow: Class JavaLaunchHelper is implemented in both. One of the two will be used. Which one is undefined
请不要直接回复这封电子邮件,而是转到 StackOverflow: JavaLaunchHelper 类在两者中都实现了。将使用两者之一。哪个是未定义的
回答by paradite
Not sure if this is the cause of the problem, but I got this issue only after installing JVM Monitor.
不确定这是否是问题的原因,但我仅在安装JVM Monitor后才遇到此问题。
Uninstalling JVM Monitor solved the issue for me.
卸载 JVM Monitor 为我解决了这个问题。
回答by guy.gc
To solve this issue, I downgraded to JDK version 1.7.0_21. then I used thislittle bash script to change the version I use.
为了解决这个问题,我降级到JDK 版本 1.7.0_21。然后我使用这个小 bash 脚本来更改我使用的版本。
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
function removeFromPath() {
export PATH=$(echo $PATH | sed -E -e "s;:;;" -e "s;:?;;")
}
Once you have the bash script in your zshrc/bshrc file, just call setJdk 1.7.0_21
and you're good to go.
一旦您的 zshrc/bshrc 文件中有 bash 脚本,只需调用setJdk 1.7.0_21
即可。
回答by wyxiloveu
jdk-7u80-macosx-x64.dmg fix this problem.
jdk-7u80-macosx-x64.dmg 修复了这个问题。
回答by Pritesh Jain
Copy Pasting @Lichtamberg's comments to gotoalberto's answer
将@Lichtamberg 的评论复制粘贴到 gotoalberto 的回答中
Works also for Java 1.8:
也适用于 Java 1.8:
# in ~/.zshrc and ~/.bashrc
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
This fixed my issue on java 8.
这解决了我在 java 8 上的问题。
回答by demogar
Well, after some struggling, what worked for me was completely removing the current JDK, as described here:
好吧,经过一番挣扎,对我有用的是完全删除当前的 JDK,如下所述:
sudo rm -rf /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -rf /Library/LaunchAgents/com.oracle.java.Java-Updater.plist
sudo rm -rf /Library/PrivilegedHelperTools/com.oracle.java.JavaUpdateHelper
sudo rm -rf /Library/LaunchDaemons/com.oracle.java.JavaUpdateHelper.plist
sudo rm -rf /Library/Preferences/com.oracle.java.Helper-Tool.plist
Then installed 1.7.0_21, which was downloaded from here.
然后安装了从这里下载的1.7.0_21 。
Now java -version
prompts:
现在java -version
提示:
java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b12)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)
回答by muttonUp
As of October 2017, this issue is now resolvedin
截至2017年10月,这个问题现在解决了在
回答by rust
?? For JetBrains IntelliJ IDEA: Go to Help -> Edit Custom Properties...
. Create the file if it asks you to create it. To disable the error message paste the following to the file you created:
?? 对于 JetBrains IntelliJ IDEA:转到 Help -> Edit Custom Properties...
. 如果它要求您创建文件,请创建该文件。要禁用错误消息,请将以下内容粘贴到您创建的文件中:
idea_rt
idea.no.launcher=true
This will take effect on the restart of the IntelliJ.
这将在 IntelliJ 重新启动时生效。
I am running Eclipse IDE for Java Developers Version: Photon Release (4.8.0) Build id: 20180619-1200 on a Mac (with MacOs 10.14.6). I added the line "idea.no.launcher=true" into /eclipse/configuration/config.ini and this has solved the problem for me.
我正在运行 Eclipse IDE for Java Developers Version: Photon Release (4.8.0) Build id: 20180619-1200 on a Mac (with MacOs 10.14.6)。我将“idea.no.launcher=true”行添加到/eclipse/configuration/config.ini 中,这为我解决了问题。