Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 260
  • 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)
 
Bartender
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: 260
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic