title: How to preserve file permissions with Java across different operating systems?
body: <p>I'm currently developing a cross-platform application (Windows, Mac OS X, Linux) with Java and building the project on Windows. During the build process, I construct a shell-script for Linux to &quot;wrap&quot; the executable jar-file.</p>
  <p>I set the executable bit of the shell script as follows:</p>
  <pre><code>File script = new File(&quot;run.sh&quot;);
  script.setExecutable(true);
  </code></pre>
  <p>But when transferring the run.sh file to Linux, I always end up with the following permissions:</p>
  <pre><code>-rw-r--r-- 1 salocinx salocinx 120 2014-08-20 20:21 run.sh
  </code></pre>
  <p>Anybody knows how to preserve the x-bit from Windows to Linux ?</p>