0

Following is the error message while running build command in gradle. I am migrating from tomcat 7 to Tomcat 9.

_jspx_imports_classes = new java.util.HashSet<>(); ^^^^^^^^^^^^^^^^^ '<>' operator is not allowed for source level below 1.7

I am using JDK 1.8 and gradle for build the code.

Parag Goel
  • 78
  • 8

1 Answers1

0

Today i fixed my issue

subprojects {
apply plugin: 'com.parag.gradle.buildinfo'

if(! assemblyProjects.contains(it)) {
        // setup source and target compatibility for jsp and add default dependencies    
        plugins.withId('com.parag.gradle') {
            tasks.withType(<taskType>) {
                sourceCompatibility = 1.8
                targetCompatibility = 1.8
                jspPackage = "org.apache.jsp.${project.name}"
            }
            
            dependencies {
                    compile 'org.apache.tomcat:tomcat-jsp-api'
            }
        }
        dependencies {
            compile 'org.apache.tomcat:tomcat-el-api'
            // compile 'javax.servlet:javax.servlet-api'
            compile 'org.apache.tomcat:tomcat-servlet-api'
        }
 }

}

Parag Goel
  • 78
  • 8