code: def environment(self):
      env = os.environ.copy()
  
      if self.java_home:
          env["JAVA_HOME"] = self.java_home
  
      if self.java_options:
          env["JAVA_OPTIONS"] = self.java_options
  
      return env
  
file_path: arrow/dev/archery/archery/lang/java.py
imports: import os
  from ..utils.command import Command, CommandStackMixin, default_bin
  from ..utils.maven import MavenDefinition
label_desc: Use image node_id 4 for calling the JavaConfiguration obj's underlying member method code with example usage: obj.environment() and returns: env