Class JavaLaunchHelper is implemented in both … li

2019-01-03 04:13发布

I upgraded to the latest Java 7 u40 on MacOS X and 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.

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?

11条回答
贪生不怕死
2楼-- · 2019-01-03 04:35

jdk-7u80-macosx-x64.dmg fix this problem.

查看更多
疯言疯语
3楼-- · 2019-01-03 04:36

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 here:

https://jdk7.java.net/download.html

It's beta, but fixed that issue for me.

查看更多
\"骚年 ilove
4楼-- · 2019-01-03 04:37

As of October 2017, this issue is now resolved in

查看更多
你好瞎i
5楼-- · 2019-01-03 04:37
  1. Install Java 7u21 from here: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html#jdk-7u21-oth-JPR

  2. set these variables:

    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home
    export PATH=$JAVA_HOME/bin:$PATH
    
  3. Run your app and fun :)

查看更多
Deceive 欺骗
6楼-- · 2019-01-03 04:41

Well, after some struggling, what worked for me was completely removing the current JDK, as described here:

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, after downloaded from here.

Now a java -version prompts:

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)
查看更多
戒情不戒烟
7楼-- · 2019-01-03 04:43

If you're using IntelliJ & Mac just go to Project structure -> SDK and make sure that there is Java listed but it points to sth like

/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home

Rather than user home...

查看更多
登录 后发表回答