code: def get_java_binpath(cmd=None):
      
      if os.environ.get("BCBIO_JAVA_HOME"):
          test_cmd = os.path.join(os.environ["BCBIO_JAVA_HOME"], "bin", "java")
          if os.path.exists(test_cmd):
              cmd = test_cmd
      if not cmd:
          cmd = Rscript_cmd()
      return os.path.dirname(cmd)
docs: Retrieve path for java to use, handling custom BCBIO_JAVA_HOME
  
      Defaults to the dirname of cmd, or local anaconda directory