"ERROR:Could not find java.nio.file.Paths" when using Oracle JDK 1.7

Posted by Ankit on Ask Ubuntu See other posts from Ask Ubuntu or by Ankit
Published on 2012-11-23T07:16:33Z Indexed on 2012/11/23 11:16 UTC
Read the original article Hit count: 368

Filed under:
|

I want to try out some features rolled out in Oracle's new JDK 1.7. I followed the post:- Oracle JDK 1.7 but the post doesn't seem to help.

I was trying to fetch out the structure for java.nio.file.Paths class file but got the following error:-

buffer@ankit:~$ javap java.nio.file.Paths ERROR:Could not find java.nio.file.Paths

However i can easily get the information about class structures till JAVA SE 1.6, here is an example:-

buffer@ankit:~$ javap java.lang.Object
Compiled from "Object.java"
public class java.lang.Object{
    public java.lang.Object();
    public final native java.lang.Class getClass();
    public native int hashCode();
    public boolean equals(java.lang.Object);
    protected native java.lang.Object clone()       throws java.lang.CloneNotSupportedException;
    public java.lang.String toString();
    public final native void notify();
    public final native void notifyAll();
    public final native void wait(long)       throws java.lang.InterruptedException;
    public final void wait(long, int)       throws java.lang.InterruptedException;
    public final void wait()       throws java.lang.InterruptedException;
    protected void finalize()       throws java.lang.Throwable;
    static {};
}

Running java -version gives the following result:-

buffer@ankit:~$ java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

SYSTEM INFORMATION

buffer@ankit:~$ sudo update-alternatives --config java
[sudo] password for buffer: 
There are 4 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1051      manual mode
  3            /usr/lib/jvm/jdk1.7.0_09/                        1         manual mode
* 4            /usr/lib/jvm/jdk1.7.0_09/bin/java                1         manual mode



buffer@ankit:~$ sudo update-alternatives --config javac
There are 2 choices for the alternative javac (providing /usr/bin/javac).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/bin/javac   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/bin/javac   1061      manual mode
* 2            /usr/lib/jvm/jdk1.7.0_09/bin/javac            1         manual mode



buffer@ankit:~$ sudo update-alternatives --config javaws
There are 3 choices for the alternative javaws (providing /usr/bin/javaws).

  Selection    Path                                              Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/javaws   1061      manual mode
  2            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws   1060      manual mode
* 3            /usr/lib/jvm/jdk1.7.0_09/bin/javaws                1         manual mode

The directory structure of /usr/lib/jvm/ is as follows:-

buffer@ankit:~$ ls -l /usr/lib/jvm/
total 24
lrwxrwxrwx 1 root   root     24 Dec  2  2011 default-java -> java-1.6.0-openjdk-amd64
drwxr-xr-x 4 root   root   4096 Nov  8 16:24 java-1.5.0-gcj-4.6
lrwxrwxrwx 1 root   root     24 Dec  2  2011 java-1.6.0-openjdk -> java-1.6.0-openjdk-amd64
lrwxrwxrwx 1 root   root     20 Oct 25 00:01 java-1.6.0-openjdk-amd64 -> java-6-openjdk-amd64
lrwxrwxrwx 1 root   root     20 Oct 25 06:59 java-1.7.0-openjdk-amd64 -> java-7-openjdk-amd64
lrwxrwxrwx 1 root   root     24 Dec  2  2011 java-6-openjdk -> java-1.6.0-openjdk-amd64
drwxr-xr-x 7 root   root   4096 Nov  8 16:24 java-6-openjdk-amd64
drwxr-xr-x 3 root   root   4096 Nov  8 16:24 java-6-openjdk-common
drwxr-xr-x 5 root   root   4096 Nov  8 05:48 java-7-openjdk-amd64
drwxr-xr-x 3 root   root   4096 Nov  8 05:48 java-7-openjdk-common
drwxr-xr-x 8 buffer buffer 4096 Sep 25 09:08 jdk1.7.0_09

Any help would be highly appreciated.

© Ask Ubuntu or respective owner

Related posts about jdk

Related posts about Oracle