Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./gradlew install fails with UnsupportedClassVersionError #4154

Closed
pdkovacs opened this issue Dec 9, 2016 · 1 comment · Fixed by #4162
Closed

./gradlew install fails with UnsupportedClassVersionError #4154

pdkovacs opened this issue Dec 9, 2016 · 1 comment · Fixed by #4162

Comments

@pdkovacs
Copy link

pdkovacs commented Dec 9, 2016

Summary

./gradlew install fails with java.lang.UnsupportedClassVersionError

Actual Behavior

  1. Check (as per https://github.com/spring-projects/spring-security/blob/master/README.adoc#prerequisites) that the JAVA_HOME environment variable points to Oracle JDK 7:
$ $JAVA_HOME/bin/java -version
Picked up JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
  1. Check out sources (as per https://github.com/spring-projects/spring-security/blob/master/README.adoc#check-out-sources):
$ git clone git@github.com:spring-projects/spring-security.git
Cloning into 'spring-security'...
remote: Counting objects: 127438, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 127438 (delta 1), reused 0 (delta 0), pack-reused 127419
Receiving objects: 100% (127438/127438), 24.99 MiB | 939.00 KiB/s, done.
Resolving deltas: 100% (61511/61511), done.
  1. Change the current working directory to the root of the source tree (as per https://github.com/spring-projects/spring-security/blob/master/README.adoc#building-from-source):
$ cd spring-security/
  1. Execute ./gradlew install (as per https://github.com/spring-projects/spring-security/blob/master/README.adoc#install-all-spring--jars-into-your-local-maven-cache):
$ ./gradlew install
Picked up JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
:buildSrc:clean UP-TO-DATE
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy
Picked up JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
:buildSrc:processResources
:buildSrc:classes
:buildSrc:jar
:buildSrc:assemble
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy UP-TO-DATE
:buildSrc:processTestResources UP-TO-DATE
:buildSrc:testClasses UP-TO-DATE
:buildSrc:test UP-TO-DATE
:buildSrc:check UP-TO-DATE
:buildSrc:build

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.UnsupportedClassVersionError: org/sonarqube/gradle/SonarQubePlugin : Unsupported major.minor version 52.0
> org/sonarqube/gradle/SonarQubePlugin : Unsupported major.minor version 52.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.401 secs

Expected Behavior

I expect the command to complete without errors with a successful status (BUILD SUCCESS)

Configuration

I am not sure what else beyond the Prerequisites might be relevant here. (Maybe the git version:

$ git --version
git version 2.10.0

)

Version

It is a fresh clone.

Sample

@pdkovacs
Copy link
Author

pdkovacs commented Dec 10, 2016

The sonarqube version was upped in commit 81ebdecd8a6b from 1.2 to 2.1.-rc1. With sonarqube version 1.2, the command ./gradlew install completes successfully. (I've got a lot of [options] bootstrap class path not set in conjunction with -source 1.6 warnings, though.)

The most authoritative description about SonarQube I've found is for version 2.2 and says directly nothing about the Java version required: http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Gradle#AnalyzingwithSonarQubeScannerforGradle-Compatibility .

The page for the sonarqube gradle plugin says nothing about required Java version, but says that it is compatible with SonarQube versions 4.5+.

As for SonarQube itself:

Of course, we’ll still support running older versions of ecosystem products, e.g. SonarQube 4.5, with Java 7, and you’ll still be able to compile your project with a lower version of Java. You’ll just have to bump up the JVM version to run the analysis.

The sonarqube gradle plugin source tree for 2.1-rc1 includes this change which leads me to think that 2.1-rc1 requires Java 8.

By the by, is the following in the Spring Security FAQ still true:

Spring Security 3.0 and 3.1 require at least JDK 1.5 and also require Spring 3.0.3 as a minimum.

? If it is, shouldn't the thing be built with JDK 5 (instead of JDK 7 as is stated in the Prerequisites)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant