title: How to set Gradle `options.bootClasspath` in an os independent manner?
body: <p>Because my Java sources and targets must be JRE 1.6 compatible, I need to set <code>options.bootClasspath</code> to a path that contains the 1.6 versions of <code>rt.jar</code> and <code>jce.jar</code>. It must build on both Windows and Unix (Linux/Solaris). What is the proper way to do this? I now use the following approach in my top-level <code>build.gradle</code>, it works, but it seems far from elegant, especially the os-dependent separator <code>:</code> or <code>;</code>:</p>
  
  <pre><code>import org.apache.tools.ant.taskdefs.condition.Os
  
  subprojects {
    apply plugin: 'java'
  
    compileJava {
      sourceCompatibility = 1.6
      targetCompatibility = 1.6
      def java6_home = System.getenv("JAVA_HOME_6")
      def java6_lib = "C:/localdata/Program Files (x86)/Java/jdk1.6.0_45/jre/lib/"
  
      if (java6_home != null) {
        java6_lib = java6_home + "/jre/lib/"
      }
  
      def sep = ':'
      if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        sep = ';'
      }
      options.bootClasspath = java6_lib + "rt.jar" + sep + java6_lib + "jce.jar"
    }
  }
  </code></pre>