diff --git a/tycho_build.gradle b/tycho_build.gradle
index 40ad059f2121322cf878199cfd34f67f1cc0b964..cd93df0f51badb69b3c7d253f9ee3faae1756b9c 100644
--- a/tycho_build.gradle
+++ b/tycho_build.gradle
@@ -205,7 +205,7 @@ def addRunTimeLib(String libPar, String projectPar) {
 	newMf.delete()
 	mf.eachLine {line ->
 		if (line ==~ /.*Bundle-ClassPath:.*\.jar.*/) {
-			libsInLine = line.replaceAll(/[\ \t]*Bundle-ClassPath:[\ \t]*/, '')
+			def libsInLine = line.replaceAll(/[\ \t]*Bundle-ClassPath:[\ \t]*/, '')
 			line = line.replaceFirst(/[^\ \t]*\.jar[\ \,]*/, dependencyFolder + libPar + ",\n " + libsInLine) // /[^\ \t]*.\.jar[\ \,]*/
 		} else {
 			if (line ==~ /.*Bundle-ClassPath: \.[\ \t]*/) {