我试图从我的机器上运行jconsole,但是找不到.sh的位置。我尝试在其他目录中找到它,并将JAVA_HOME设置为jdk。

$which java
/usr/bin/java
$java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (rhel-2.4.4.1.el6_5-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
$whereis java
java: /usr/bin/java /etc/java /usr/lib/java /usr/share/java /usr/share/man/man1/java.1.gz

我查看了/usr/lib/jvm,发现
drwxr-xr-x. 3 root root 4096 Apr 23  2013 java-1.5.0-gcj-1.5.0.0
drwxr-xr-x. 3 root root 4096 Jan 27  2014 java-1.6.0-openjdk-1.6.0.0.x86_64
drwxr-xr-x. 3 root root 4096 Feb  5  2014 java-1.7.0-openjdk-1.7.0.51.x86_64
lrwxrwxrwx. 1 root root   21 Feb  5  2014 jre -> /etc/alternatives/jre
lrwxrwxrwx. 1 root root   27 Apr 23  2013 jre-1.5.0 -> /etc/alternatives/jre_1.5.0
lrwxrwxrwx. 1 root root   26 Apr 23  2013 jre-1.5.0-gcj -> java-1.5.0-gcj-1.5.0.0/jre
lrwxrwxrwx. 1 root root   27 Feb  5  2014 jre-1.6.0 -> /etc/alternatives/jre_1.6.0
lrwxrwxrwx. 1 root root   37 Feb  5  2014 jre-1.6.0-openjdk.x86_64 -> java-1.6.0-openjdk-    1.6.0.0.x86_64/jre
lrwxrwxrwx. 1 root root   27 Feb  5  2014 jre-1.7.0 -> /etc/alternatives/jre_1.7.0
lrwxrwxrwx. 1 root root   38 Feb  5  2014 jre-1.7.0-openjdk.x86_64 -> java-1.7.0-openjdk-1.7.0.51.x86_64/jre
lrwxrwxrwx. 1 root root   25 Apr 23  2013 jre-gcj -> /etc/alternatives/jre_gcj
lrwxrwxrwx. 1 root root   29 Feb  5  2014 jre-openjdk -> /etc/alternatives/jre_openjdk

并且在java-1.7.0-openjdk-1.7.0.51.x86_64/jre/bin/中,我只发现了
[root@portal01 bin]# ll
total 200
-rwxr-xr-x. 1 root root  9536 Jan 14  2014 java
-rwxr-xr-x. 1 root root  9656 Jan 14  2014 keytool
-rwxr-xr-x. 1 root root  9856 Jan 14  2014 orbd
-rwxr-xr-x. 1 root root  9688 Jan 14  2014 pack200
-rwxr-xr-x. 1 root root 10984 Jan 14  2014 policytool
-rwxr-xr-x. 1 root root  9648 Jan 14  2014 rmid
-rwxr-xr-x. 1 root root  9656 Jan 14  2014 rmiregistry
-rwxr-xr-x. 1 root root  9688 Jan 14  2014 servertool
-rwxr-xr-x. 1 root root  9896 Jan 14  2014 tnameserv
-rwxr-xr-x. 1 root root 92264 Jan 14  2014 unpack200

..即使有200个文件。我如何找到并运行jconsole?

最佳答案

jconsole是Java SDK的一部分,看来您只安装了JRE。

10-08 12:08