sonyxperiadev / gerrit-events

MIT License
47 stars 62 forks source link

Doc: update required java version #46

Closed zaro0508 closed 8 years ago

zaro0508 commented 8 years ago

This library now requires Java 1.7 because Java java.nio.file.Files package was introduced in Java 7. Compilers from earlier versions of the JDK will baulk at any code that references this class.

rsandell commented 8 years ago

Java nio was introduced in Java 1.4 (see for example http://docs.oracle.com/javase/7/docs/api/java/nio/Buffer.html) If trhere is anything that hinders compilation in Java 1.6 we should fix that instead. I would like to keep 1.6 compatibility for a little while longer.

zaro0508 commented 8 years ago

Sorry, the commit message was not specific enough. It's actually the Files (https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html) object that was introduced in java 1.7 . Here's the failure using java 1.6:

~/work-jenkins/gerrit-events$ mvn -version Picked up _JAVA_OPTIONS: -Djava.awt.headless=true -Xmx1024M -XX:+UseConcMarkSweepGC Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 08:22:22-0700) Maven home: /usr/local/Cellar/maven/3.1.1/libexec Java version: 1.6.0_65, vendor: Apple Inc. Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home Default locale: en_US, platform encoding: MacRoman OS name: "mac os x", version: "10.9.5", arch: "x86_64", family: "mac" ~/work-jenkins/gerrit-events$ mvn clean package -Dmaven.test.skip=true Picked up _JAVA_OPTIONS: -Djava.awt.headless=true -Xmx1024M -XX:+UseConcMarkSweepGC [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Gerrit Events Client library 2.9.3-SNAPSHOT [INFO] ------------------------------------------------------------------------ [WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2 [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ gerrit-events --- [INFO] Deleting /Users/khaido/work-jenkins/gerrit-events/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gerrit-events --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/khaido/work-jenkins/gerrit-events/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ gerrit-events --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 79 source files to /Users/khaido/work-jenkins/gerrit-events/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/khaido/work-jenkins/gerrit-events/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshUtil.java:[31,21] package java.nio.file does not exist [ERROR] /Users/khaido/work-jenkins/gerrit-events/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshUtil.java:[61,53] cannot find symbol symbol : method toPath() location: class java.io.File [ERROR] /Users/khaido/work-jenkins/gerrit-events/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshUtil.java:[61,27] cannot find symbol symbol : variable Files location: class com.sonymobile.tools.gerrit.gerritevents.ssh.SshUtil [INFO] 3 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.133s [INFO] Finished at: Tue Oct 06 10:09:45 PDT 2015 [INFO] Final Memory: 12M/81M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project gerrit-events: Compilation failure: Compilation failure: [ERROR] /Users/khaido/work-jenkins/gerrit-events/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshUtil.java:[31,21] package java.nio.file does not exist [ERROR] /Users/khaido/work-jenkins/gerrit-events/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshUtil.java:[61,53] cannot find symbol [ERROR] symbol : method toPath() [ERROR] location: class java.io.File [ERROR] /Users/khaido/work-jenkins/gerrit-events/src/main/java/com/sonymobile/tools/gerrit/gerritevents/ssh/SshUtil.java:[61,27] cannot find symbol [ERROR] symbol : variable Files [ERROR] location: class com.sonymobile.tools.gerrit.gerritevents.ssh.SshUtil [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException ~/work-jenkins/gerrit-events$

rsandell commented 8 years ago

Fixed the issue in ca55f35b0ac6d8829cd2a8d7c858d9af97eac048