title: Gradle & Log4j - Unsupported Major.minor version 51.0 when trying to build
body: <p>I am using gradle to build and distribute a project, but I am getting an error whenever I try to use build command. </p>
  
  <p>Here is the error message: </p>
  
  <pre><code>C:\Users\jamatic\workspace\PersonModule&gt;gradle clean build cleaneclipse eclipse
  --stacktrace
  :clean
  :compileJava
  error: Exception thrown while constructing Processor object: org/apache/logging/
  log4j/core/config/plugins/processor/PluginProcessor : Unsupported major.minor ve
  rsion 51.0
  :compileJava FAILED
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':compileJava'.
  &gt; Compilation failed; see the compiler error output for details.
  
  * Try:
  Run with --info or --debug option to get more log output.
  
  * Exception is:
  org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compile
  Java'.
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
  ecuteActions(ExecuteActionsTaskExecuter.java:69)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
  ecute(ExecuteActionsTaskExecuter.java:46)
          at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExec
  uter.execute(PostExecutionAnalysisTaskExecuter.java:35)
          at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.exec
  ute(SkipUpToDateTaskExecuter.java:64)
          at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execut
  e(ValidatingTaskExecuter.java:58)
          at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecu
  ter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
          at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter
  .execute(SkipTaskWithNoActionsExecuter.java:52)
          at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execut
  e(SkipOnlyIfTaskExecuter.java:53)
          at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter
  .execute(ExecuteAtMostOnceTaskExecuter.java:43)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa
  skWorker.execute(DefaultTaskGraphExecuter.java:203)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTa
  skWorker.execute(DefaultTaskGraphExecuter.java:185)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorW
  orker.processTask(AbstractTaskPlanExecutor.java:62)
          at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorW
  orker.run(AbstractTaskPlanExecutor.java:50)
          at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(Defaul
  tTaskPlanExecutor.java:25)
          at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(Defau
  ltTaskGraphExecuter.java:110)
          at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTask
  ExecutionAction.java:37)
          at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
  r.java:37)
          at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExec
  uter.java:23)
          at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecu
  ter.java:43)
          at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildEx
  ecutionAction.java:32)
          at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
  r.java:37)
          at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecute
  r.java:30)
          at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLa
  uncher.java:158)
          at org.gradle.internal.Factories$1.create(Factories.java:22)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul
  tBuildOperationExecutor.java:90)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul
  tBuildOperationExecutor.java:52)
          at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(Default
  GradleLauncher.java:155)
          at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGra
  dleLauncher.java:36)
          at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradl
  eLauncher.java:103)
          at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradl
  eLauncher.java:97)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul
  tBuildOperationExecutor.java:90)
          at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(Defaul
  tBuildOperationExecutor.java:62)
          at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradle
  Launcher.java:97)
          at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLaun
  cher.java:86)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildCon
  troller.run(InProcessBuildActionExecuter.java:102)
          at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(Exe
  cuteBuildActionRunner.java:28)
          at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildA
  ctionRunner.java:35)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
  ssBuildActionExecuter.java:47)
          at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProce
  ssBuildActionExecuter.java:32)
          at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(Contin
  uousBuildActionExecuter.java:77)
          at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(Contin
  uousBuildActionExecuter.java:47)
          at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.exe
  cute(DaemonUsageSuggestingBuildActionExecuter.java:51)
          at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.exe
  cute(DaemonUsageSuggestingBuildActionExecuter.java:28)
          at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
          at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.jav
  a:170)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
  execute(CommandLineActionFactory.java:237)
          at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.
  execute(CommandLineActionFactory.java:210)
          at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
  meValidationAction.java:35)
          at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRunti
  meValidationAction.java:24)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
  CommandLineActionFactory.java:206)
          at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(
  CommandLineActionFactory.java:169)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
  ortingAction.java:33)
          at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionRep
  ortingAction.java:22)
          at org.gradle.launcher.Main.doAction(Main.java:33)
          at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBoots
  trap.java:54)
          at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.j
  ava:35)
          at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
  Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Com
  pilation failed; see the compiler error output for details.
          at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJava
  Compiler.java:47)
          at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJava
  Compiler.java:33)
          at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegat
  eAndHandleErrors(NormalizingJavaCompiler.java:101)
          at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute
  (NormalizingJavaCompiler.java:50)
          at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute
  (NormalizingJavaCompiler.java:36)
          at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.exe
  cute(CleaningJavaCompilerSupport.java:34)
          at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.exe
  cute(CleaningJavaCompilerSupport.java:25)
          at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompi
  le.java:157)
          at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:139
  )
          at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:93)
  
          at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
  actory$IncrementalTaskAction.doExecute(AnnotationProcessingTaskFactory.java:243)
  
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
  actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:219)
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
  actory$IncrementalTaskAction.execute(AnnotationProcessingTaskFactory.java:230)
          at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskF
  actory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:208)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
  ecuteAction(ExecuteActionsTaskExecuter.java:80)
          at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.ex
  ecuteActions(ExecuteActionsTaskExecuter.java:61)
          ... 57 more
  
  
  BUILD FAILED
  
  Total time: 4.027 secs
  
  C:\Users\jamatic\workspace\PersonModule&gt;
  </code></pre>
  
  <p>I have checked my build.gradle file and I see that the source compatibility is 1.6 . Here is my Gradle build file: </p>
  
  <pre><code>/*** Gradle build file for PersonModule ***/
  
  apply plugin: 'java'
  apply plugin: 'java-library-distribution'
  apply plugin: 'eclipse'
  
  sourceCompatibility = 1.6
  
  version = '2.2.5.5'
  
  repositories {
      mavenCentral();
  
      ivy {
          url "Y://dev/shared-libs/ivy2"
      }
  }
  
  dependencies {
      compile 'no.solarsoft.admit.client:Venus2Core2:2.0+'
  }
  
  jar {
      // Keep jar clean:
      exclude 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'META-INF/*.MF'
  
      manifest {
         attributes 'Main-Class': 'no.solarsoft.venus2.application.personmodule.PersonModule',
                    'Class-Path': configurations.runtime.files.collect { "lib/$it.name" }.join(' ')
      }
  }
  </code></pre>
  
  <p>I have also checked the java version and java build path: </p>
  
  <p><a href="https://i.stack.imgur.com/K8sdm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K8sdm.png" alt="Java version"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Gw25E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gw25E.png" alt="build path"></a></p>
  
  <p>I hope someone can help me find the solution to this error. Thanks! </p>
  
  <p>P.S I think this question is somehow different from the other Unsupported major.minor questions. </p>