I am working on this tutorial and having a few issues. Here is the problem "Create a file using any word-processing program or text editor. Write an application that displays the file's name, containing folder, size, and time of last modification. Save file as FileStatistics.java"
Here is what I have:
And this is the errors that I receive when I try to compile it: (I am using jGRASP)
----jGRASP exec: javac -g FileStatistics.java
FileStatistics.java:3: error: cannot find symbol
import java.nio.file.attribute.Attributes;
^
symbol: class Attributes
location: package java.nio.file.attribute
FileStatistics.java:15: error: method getName in interface Path cannot be applied to given types;
System.out.println("File name is " + file.getName());
^
required: int
found: no arguments
reason: actual and formal argument lists differ in length
FileStatistics.java:18: error: cannot find symbol
Attributes.readBasicFileAttributes(file);
^
symbol: variable Attributes
location: class FileStatistics
3 errors
----jGRASP wedge2: exit code for process is 1.
----jGRASP: operation complete.
I think I may be getting errors because of some compatibility issues with Java 7. Is there anything you can see that might be causing it?
Thanks,
-John
Sana: Added code tags