Fix temp_dir to work in jruby