diff --git a/build.gradle b/build.gradle
index 36770332c8966f574f9fba8b1016b1f0013b976a..0dcf6c9ed3e7aa3718d450d5a42c65f37b0c7f95 100644
--- a/build.gradle
+++ b/build.gradle
@@ -23,8 +23,10 @@ group = 'it.unibz.inf.isochrone'
 version = '0.2.3-SNAPSHOT'
 
 description = 'PhD project of Nikolaus Krismer'
-sourceCompatibility=1.7
-targetCompatibility=1.7
+sourceCompatibility=JavaVersion.VERSION_1_7
+targetCompatibility=JavaVersion.VERSION_1_7
+//sourceCompatibility=JavaVersion.VERSION_1_8
+//targetCompatibility=JavaVersion.VERSION_1_8
 
 /*
  * Version handling:
@@ -157,7 +159,7 @@ dependencies {
 	testCompile 'org.testng:testng:6+'
 }
 
-tasks.withType(Compile) {
+tasks.withType(JavaCompile) {
 	// adds support for compiler warnings generation
 	options.compilerArgs << '-Xlint:all,-processing'
 }
@@ -187,6 +189,29 @@ checkstyle {
 }
 
 eclipse {
+	classpath {
+		file {
+			// See: http://forums.gradle.org/gradle/topics/eclipse_wtp_deploys_testcode_to_server_example_provided
+			// Sets output folders for compiled classes and resources... otherwise test classes/resources would be deployed to wtp server
+			whenMerged { cp ->
+				cp.entries.findAll { it.path.startsWith("src/main/") }*.output = "bin"
+				cp.entries.findAll { it.path.startsWith("src/test/") }*.output = "bin-test"
+				// Sets JavaSE as jdk version used (instead of version directly)
+		        cp.entries.findAll { it.path.contains('JRE_CONTAINER') }.each {
+		            it.path += "/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-" + sourceCompatibility
+		        }
+			}
+
+			// See: http://stackoverflow.com/questions/12836089/why-is-eclipse-not-attaching-3rd-party-libs-source-files-to-a-wtp-faceted-gradle
+			// Chnanges eclipse classpath entries; otherwise no sources for 3rd party jars are shown
+			withXml { xml ->
+				def node = xml.asNode()
+				node.remove( node.find { it.@path == 'org.eclipse.jst.j2ee.internal.web.container' } )
+				node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
+			}
+		}
+	}
+
 	project {
 		buildCommand 'net.sf.eclipsecs.core.CheckstyleBuilder'
 
@@ -234,29 +259,12 @@ eclipse {
 			// when tomcat 8 becomes usable in eclipse this jst.web version should be set to 3.1
 			//facet name: 'jst.web', version: '3.1'
 			facet name: 'jst.web', version: '3.0'
-			facet name: 'jst.java', version: '1.7'
+			facet name: 'jst.java', version: sourceCompatibility
 			facet name: 'wst.jsdt.web', version: '1.0'
 		}
 	}
 }
 
-eclipse.classpath.file {
-	// See: http://stackoverflow.com/questions/12836089/why-is-eclipse-not-attaching-3rd-party-libs-source-files-to-a-wtp-faceted-gradle
-	// Chnanges eclipse classpath entries; otherwise no sources for 3rd party jars are shown
-	withXml { xml ->
-		def node = xml.asNode()
-		node.remove( node.find { it.@path == 'org.eclipse.jst.j2ee.internal.web.container' } )
-		node.appendNode( 'classpathentry', [ kind: 'con', path: 'org.eclipse.jst.j2ee.internal.web.container', exported: 'true'])
-	}
-
-	// See: http://forums.gradle.org/gradle/topics/eclipse_wtp_deploys_testcode_to_server_example_provided
-	// Sets output folders for compiled classes and resources... otherwise test classes/resources would be deployed to wtp server
-	whenMerged { cp ->
-		cp.entries.findAll { it.path.startsWith("src/main/") }*.output = "bin"
-		cp.entries.findAll { it.path.startsWith("src/test/") }*.output = "bin-test"
-	}
-}
-
 findbugs {
 	effort = "max"
 	ignoreFailures = true