Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3675  / 2 Years ago, thu, june 23, 2022, 9:44:04

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.


More From » jdk

 Answers
5

java executable


Java consists of many individual executables - javac and javaws are the most common.


javap is another - when installing Java you need to individually ensure that each executable has been registered - you do so with update-alternatives



sudo update-alternatives --install "/usr/bin/java" "javap" "/usr/lib/jvm/jdk1.7.0/bin/javap" 1
sudo update-alternatives --config javap

This answer gives you a list of the individual executables that you can register if you wish to use them during development.



Alternatively - you could use a third-part PPA such as webupd8 - but as a developer myself, I like to understand the issues and tailor my configuration to my needs.


[#34096] Friday, June 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
repend

Total Points: 195
Total Questions: 113
Total Answers: 107

Location: Nicaragua
Member since Tue, Dec 8, 2020
3 Years ago
repend questions
Thu, May 11, 23, 09:38, 1 Year ago
Thu, Jan 5, 23, 21:41, 1 Year ago
Mon, Nov 22, 21, 19:37, 3 Years ago
Mon, Jan 24, 22, 11:26, 2 Years ago
;