Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic