 +            os.unlink(f.name)
 +        f = NamedTemporaryFile(mode='wb', suffix='.txt', prefix ='java_src_path_', delete=False) #FML: We write to a temporary file just in case the command is to long
 +        for line in pkglist:
-+            f.write('"%s"\n' % os.path.abspath(line))
++            if os.sep == '\\':
++                f.write('"%s"\n' % os.path.abspath(line).replace('\\', '\\\\'))
++            else:
++                f.write('"%s"\n' % os.path.abspath(line))
 +        f.close()
 +        dirs = '@"%s"' % f.name
          classpath = os.pathsep.join(cplk[side])
          forkcmd = self.cmdrecomp.format(classpath=classpath, sourcepath=pathsrclk[side], outpath=pathbinlk[side],
                                          pkgs=dirs)
-@@ -1336,9 +1353,10 @@
+@@ -1336,9 +1359,10 @@
              self.logger.error('==================')
              self.logger.error('')
              raise

-            dirs = ' '.join(pkglistscala)
+            f = NamedTemporaryFile(mode='wb', suffix='.txt', prefix ='scala_src_path_', delete=False) #FML: We write to a temporary file just in case the command is to long
+            for line in pkglistscala:
+                f.write('"%s"\n' % os.path.abspath(line))
+            f.close()
+            dirs = '@"%s"' % f.name
             classpath = os.pathsep.join(cplk[side])
             forkcmd = self.cmdrecompscala.format(classpath=classpath, sourcepath=pathsrclk[side], outpath=pathbinlk[side], pkgs=dirs)
             try:
@@ -1317,7 +1329,12 @@
                 self.logger.error('================================')
                 self.logger.error('')
                 raise

         classpath = [os.path.join('..', p) for p in classpath]
         classpath = os.pathsep.join(classpath)
         os.chdir(self.dirjars)
@@ -1703,7 +1727,7 @@
         self.runcmd(forkcmd)
         return True
 
