code: def to_jarray(j_type, arr):
      """
      Convert python list to java type array
  
      :param j_type: java type of element in array
      :param arr: python type list
      """
      gateway = get_gateway()
      j_arr = gateway.new_array(j_type, len(arr))
      for i in range(0, len(arr)):
          j_arr[i] = arr[i]
      return j_arr
  
file_path: flink/flink-python/pyflink/util/java_utils.py
imports: from datetime import timedelta
  from py4j.java_gateway import JavaClass, get_java_class, JavaObject
  from py4j.protocol import Py4JJavaError
  from pyflink.java_gateway import get_gateway
label_desc: Use image node_id 1 for calling a global function with example usage: to_jarray(j_type, arr) and returns: j_arr