wood burning stoves 2.0*
The moose likes Java in General and the fly likes jdk7 compile error : TreeCopier is not abstract &does not override abstract method preVisitDirectory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "jdk7 compile error : TreeCopier is not abstract &does not override abstract method preVisitDirectory" Watch "jdk7 compile error : TreeCopier is not abstract &does not override abstract method preVisitDirectory" New topic
Author

jdk7 compile error : TreeCopier is not abstract &does not override abstract method preVisitDirectory

albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
I download a sample java program from http://download.oracle.com/javase/tutorial/essential/io/examples/Copy.java
and it has compile errors with jdk7 on Windows XP.

C:\javadev\Backup\src>"C:\Program Files\Java\jdk1.7.0\bin\javac" Copy.java
Copy.java:74: TreeCopier is not abstract and does not override abstract method preVisitDirectory(Pat
h,BasicFileAttributes) in FileVisitor
static class TreeCopier implements FileVisitor<Path> {
^
Copy.java:87: method does not override or implement a method from a supertype
@Override
^
Copy.java:106: method does not override or implement a method from a supertype
@Override
^
3 errors

My default JDK is 6 and coexists with jdk7.
Path=C:\Program Files\Java\jdk1.6.0_19\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:
\Program Files\Windows Imaging\;C:\Program Files\TortoiseSVN\bin;C:\Sun\SDK\bin

C:\javadev\Backup\src>"C:\Program Files\Java\jdk1.7.0\bin\java" -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b115)
Java HotSpot(TM) Client VM (build 20.0-b02, mixed mode, sharing)
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Compiles just fine here.

C:\Program Files (x86)\Java\jdk1.7.0\bin>java -version
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b112)
Java HotSpot(TM) Client VM (build 20.0-b01, mixed mode, sharing)


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
My jdk 7 can compile a "Hello World" program correctly so why it can't compile a sample java program?
C:\javadev\Hello>"C:\Program Files\Java\jdk1.7.0\bin\javac" Hello.java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jdk7 compile error : TreeCopier is not abstract &does not override abstract method preVisitDirectory