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


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


rather than user home...


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/
sudo rm -rf /library/privilegedhelpertools/
sudo rm -rf /library/launchdaemons/
sudo rm -rf /library/preferences/

then installed 1.7.0_21, which was downloaded from here.

now 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)


july 2019

osx mojave 10.14.5 (18f132) intellij 2019-1 community edition. it worked setting file. i also configured java_home pointing to /library/java/javavirtualmachines/jdk1.8.0_121.jdk/contents/home/

custom intellij idea properties



to solve this issue, i downgraded to jdk version 1.7.0_21. then i used this little bash script to change the version i use.

function setjdk() {
  if [ $# -ne 0 ]; then
   removefrompath '/system/library/frameworks/javavm.framework/home/bin'
   if [ -n "${java_home+x}" ]; then
    removefrompath $java_home
   export java_home=`/usr/libexec/java_home -v $@`
   export path=$java_home/bin:$path

 function removefrompath() {
  export path=$(echo $path | sed -e -e "s;:$1;;" -e "s;$1:?;;")

once you have the bash script in your zshrc/bshrc file, just call setjdk 1.7.0_21 and you're good to go.


from what i've found online, this is a bug introduced 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.

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.

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


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:

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


not sure if this is the cause of the problem, but i got this issue only after installing jvm monitor.

uninstalling jvm monitor solved the issue for me.


copy pasting @lichtamberg's comments to gotoalberto's answer

works also for 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.


  1. install java 7u21 from:

  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 have fun :)


as of october 2017, this issue is now resolved in


⚠️ 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:


this will take effect on the restart of the intellij.

Related Query

More Query from same tag