Class JavaLaunchHelper is implemented in both

I was getting the below error which compiling my code.

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

Solution.

Upgrade JDK to the latest version from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Details related are also discussed at https://stackoverflow.com/questions/18794573/class-javalaunchhelper-is-implemented-in-both-libinstrument-dylib-one-of-th