17

I'm trying to launch Cassandra and I'm running into an issue with JavaLaunchHelper being located in two places. I'm running Java 8. Here's the exact error:

objc[413]: Class JavaLaunchHelper is implemented in both
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/bin/java and 
/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/jre/lib/libinstrument.dylib. 
One of the two will be used. Which one is undefined.

Found a similar question for Java 7:

Class JavaLaunchHelper is implemented in both. One of the two will be used. Which one is undefined

What's the best way to go about solving this?

Community
  • 1
  • 1
user3181113
  • 758
  • 2
  • 11
  • 23

5 Answers5

16

This is a bug in the JDK and is still not fixed (as of 8u25). See more info here.

Community
  • 1
  • 1
J.R. Garcia
  • 639
  • 5
  • 20
1

Shouldn't be a problem, just an annoying message. But Cassandra hasn't been verified against java 8 yet, so you may see some strangeness.

Zanson
  • 3,991
  • 25
  • 31
1

You must go to Preferences/Build, Execution, Deployment/Debugger and disable the option: "Force Classic VM for JDK 1.3.x and earlier" This works for me

David Figueroa
  • 365
  • 2
  • 6
0

put lines to files ~/.bashrc (or/and ~/.zshrc) and save

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home 
export PATH=$JAVA_HOME/bin:$PATH

and then restart (logout/login) terminal (IDE)

Andrew
  • 36,676
  • 11
  • 141
  • 113
  • 1
    This doesn't work for me. Both are set and the warning still occurs with 1.8.0_111 in both zsh and bash. – Spanky Quigman Nov 01 '16 at 02:32
  • I'm running jdk1.8.0_102 and I still get the error even after trying this solution as well – MichaelF Feb 13 '17 at 00:35
  • @MichaelF Check if you're using java version you want with terminal command "java -version" – Andrew Feb 13 '17 at 15:41
  • @Andrey Yes, it is running the right version. I just continually get this now, even if I am running with your fixes to the bashrc – MichaelF Feb 13 '17 at 18:41
0

Two steps fix this problem:

1.Navigate to /Library/Internet Plug-Ins and remove the JavaAppletPlugin.plugin directory.

2.Navigate to /Library/PreferencePanes and remove JavaControlPanel.prefpane.

Essentially, do one thing: uninstall jre !