Why is the Java 7 runtime inconsistent with the Java 7 documentation for subpackages of java.nio?

StackOverflow https://stackoverflow.com/questions/9332974

  •  30-04-2021
  •  | 
  •  

Question

I'm encountering multiple inconsistencies between the Java 7 runtime library and the Java 7 documentation for subpackages of java.nio on my Linux workstation. For example, the class

$ jar tf /usr/java/jdk1.7.0/jre/lib/rt.jar | fgrep java/nio/file/attribute/Attributes
java/nio/file/attribute/Attributes.class

Doesn't even exist in what I believe is the official documentation, http://docs.oracle.com/javase/7/docs/api/.

Does anyone know why these discrepancies exist and/or a workaround?

Was it helpful?

Solution

I suspect that you the runtime version that you have is not a final one, though you are reviewing the documentation of the stable java 7 version.

Here's the documentation for that class: http://download.java.net/jdk7/archive/b124/docs/api/java/nio/file/attribute/Attributes.html

As you can notice it's for the version 7 build 124, and it states there at the top:

Please note that the specifications and other information contained herein are not final and are subject to change. The information is being made available to you solely for purpose of evaluation.

OTHER TIPS

You must have a prerelase of Java 7 JDK installed on your machine, the final releases do not have that class anymore.
You can download and install the current release directly from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/index.html

PS
Hints:

  • remember to download the version suitable for you Linux installation: 32 or 64 bit
  • I had good results with both installation types, rpm and tar.gz, although I prefer the latter one for fast experiments with multiple JDKs.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top