aspose file tools
The moose likes Features new in Java 7 and the fly likes Java 7 Confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Features new in Java 7
Reply Bookmark "Java 7 Confusion" Watch "Java 7 Confusion" New topic
Author

Java 7 Confusion

Sverre Moe
Ranch Hand

Joined: Jul 10, 2007
Posts: 109
I have just installed Java 7 and begun to look at the Java 7 NIO.2.
According to many different tutorials there are some differences to the official JDK7.

  • Interface FileRef is not in JDK7
  • References to path.copyTo, but method does not exist. Must instead use Files.copy
  • References to a class called Attributes, but does not exist. BasicFileAttributes basic = Attributes.readBasicFileAttributes. Must instead use Files.getFileAttributeView.


  • Jesper de Jong
    Java Cowboy
    Bartender

    Joined: Aug 16, 2005
    Posts: 12929
        
        3

    Are those tutorials based on some earlier draft version of NIO2? There might have been some changes between the time when those tutorials were written and the official release of Java 7.


    Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
    Scala Notes - My blog about Scala
    Sverre Moe
    Ranch Hand

    Joined: Jul 10, 2007
    Posts: 109
    Al tutorials I have come across are a bit seasoned. So it might be that they are a little bit outdated.
    Jesper de Jong
    Java Cowboy
    Bartender

    Joined: Aug 16, 2005
    Posts: 12929
        
        3

    Some (all?) of Oracle's tutorials have been updated to the new Java 7 standards, for example the File I/O tutorial. I'd expect those to be up-to-date with the final Java 7 release.
    Sverre Moe
    Ranch Hand

    Joined: Jul 10, 2007
    Posts: 109
    Jesper de Jong wrote:Some (all?) of Oracle's tutorials have been updated to the new Java 7 standards, for example the File I/O tutorial. I'd expect those to be up-to-date with the final Java 7 release.


    I have just gone through Oracle's tutorial on Java 7 NIO.2 and they are updated to conform with the official JDK7.
     
    I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
     
    subject: Java 7 Confusion
     
    Similar Threads
    java 7 and 8
    switch by String not possible, so why does Java tutorial say it is?
    I had these two jsp interview questions
    list of Java 7 and 8 features
    Possible issue with Java 7