code: def get_java_path(jdk_dir):
      # deprecated - to be deleted
      java_paths = (
          os.path.join(jdk_dir, "bin", "java"),
          os.path.join(jdk_dir, "bin", "java.exe"),
      )
  
      for p in java_paths:
          if os.path.exists(p):
              return p
  
      for f in os.listdir(jdk_dir):
          if f.endswith(".tar"):
              with contextlib.closing(
                  tarfile.open(os.path.join(jdk_dir, f))
              ) as tf:
                  tf.extractall(jdk_dir)
  
      for p in java_paths:
          if os.path.exists(p):
              return p
  
      return ""
  
imports: import os
  import tarfile
  import contextlib
  from .None import runtime
label_desc: Use image node_id 1 for calling a global function with example usage: get_java_path(jdk_dir) and returns: str, p, p