def __finalize_hdfs(self, ext):
java_home = jvm.get_java_home()<EOL>jvm_lib_path, _ = jvm.get_jvm_lib_path_and_name(java_home)<EOL>ext.include_dirs = jvm.get_include_dirs() + ext.include_dirs<EOL>ext.libraries = jvm.get_libraries()<EOL>ext.library_dirs = [os.path.join(java_home, "<STR_LIT>"), jvm_lib_path]<EOL>ext.define_macros = jvm.get_macros()<EOL>ext.extra_link_args = ['<STR_LIT>' % jvm_lib_path]<EOL>if self.__have_better_tls():<EOL><INDENT>ext.define_macros.append(("<STR_LIT>", None))<EOL><DEDENT>try:<EOL><INDENT>self.compiler.compiler_so.remove("<STR_LIT>")<EOL><DEDENT>except (AttributeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT>
\
        Adds a few bits that depend on the specific environment.

        Delaying this until the build_ext phase allows non-build commands
        (e.g., sdist) to be run without java.