Comment 3 for bug 486906

Revision history for this message
Rorzik (rorzik) wrote :

I get the same "Unable to find the javac compiler ..." error as above, with 10.10. It is for some reason searching under jre for the javac binary (and other components) when the compiler is not part of jre but the jdk. The fix is very simple:

I opened /usr/bin/imagej, scrolled to the very bottom where it has the line:

eval $JAVA_HOME/bin/java ${arch} -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}

And I deleted the "$JAVA_HOME/bin/", changing it to:

eval java ${arch} -mx${mem}m ${jni} ${modules} ij.ImageJ -ijpath ${ij_user_path} -port${count} ${images} ${macrocmd} ${macroargs}

That completely fixed the problem for me. It finds java just fine using the path, only when it's using the path it also uses the path for javac, and then finds that too. When $JAVA_HOME was forcing it into the jre directory, it seemed to force it to only look there for javac. Perhaps this is a more general solution than the above ones (which were not sufficient to fix it for me, but which did point me in this direction).