title: SBT: Cross-platform way to set java.library.path?
body: <p>I was working on a project that requires loading of native libraries, and so far, all development was restricted to Linux. In order to <code>run</code> my project, I could simply enable forking and modify <code>java.library.path</code> as follows:</p>
  
  <pre><code>javaOptions in run += "-Djava.library.path=some/common/path:lib/native/linux"
  </code></pre>
  
  <p>My question is: How can I do the same in a cross-platform way, so that I can share my build.sbt with a Windows-based developer. There are in particular three things that I couldn't figure out so far:</p>
  
  <ul>
  <li>I know that SBT allows to construct platform-independent paths like <code>"dir1" / "dir2"</code>, but I'm not aware of a cross-platform way to join multiple paths (since it is <code>:</code> on Linux and <code>;</code> on Windows). </li>
  <li>Is it possible to append either <code>lib/native/linux</code> <em>or</em> <code>lib/native/windows</code> dependent on the platform?</li>
  <li>My approach above overwrites <code>java.library.path</code> -- is it possible to append instead?</li>
  </ul>