java 1.8中的jstack / jmap替代

时间:2015-09-03 12:08:19

标签: java jvm

在1.8版本中,jstack和jmap(以及可能还有其他版本)已从某些 java发行版中删除(即Windows发行版仍有它们,但它们不存在于Linux发行版中)。 / p> 甲骨文称他们是实验性的,因此,他们可以随时删除。 但是,我发现这些小工具在过去非常有用,可用于调试。例如,我经常使用jstack来打印特定java进程中的线程列表等。

问题:您是否了解它们的任何替代方案,或者Oracle是否在不提供任何内容的情况下将其删除?

修改1

显然,这发生在“服务器JRE”版本(如此http://download.oracle.com/otn/java/jdk/8u51-b16/server-jre-8u51-linux-x64.tar.gz)中,但不在JDK版本中。 这与java 1.7不同,其中服务器JRE也包含这些文件。

虽然这背后的推理现在更有意义,但我仍然想知道服务器JRE中是否有像jmap / jstack这样的替代工具(在服务器上安装jdk似乎有点麻烦,只是为了看一些线程信息)

1 个答案:

答案 0 :(得分:2)

我不确定您从哪里获取有关它们已从Linux发行版中删除的信息。我安装的最新JDK_1.8.0_60仍然有它们。

如果它消失了,jconsole会获得堆栈跟踪等等。

我从Oracle的网站上获得了标准下载:

shackle@shackle-desktop:~/NetBeansProjects/CppApplication_2$ /usr/local/jdk1.8.0_60/bin/java -XshowSettings:properties -version
Property settings:
    awt.toolkit = sun.awt.X11.XToolkit
    file.encoding = UTF-8
    file.encoding.pkg = sun.io
    file.separator = /
    java.awt.graphicsenv = sun.awt.X11GraphicsEnvironment
    java.awt.printerjob = sun.print.PSPrinterJob
    java.class.path = .
    java.class.version = 52.0
    java.endorsed.dirs = /usr/local/jdk1.8.0_60/jre/lib/endorsed
    java.ext.dirs = /usr/local/jdk1.8.0_60/jre/lib/ext
        /usr/java/packages/lib/ext
    java.home = /usr/local/jdk1.8.0_60/jre
    java.io.tmpdir = /tmp
    java.library.path = /usr/local/jdk1.8.0_60/jre/lib/i386/server
        /usr/local/jdk1.8.0_60/jre/lib/i386
        /usr/local/jdk1.8.0_60/jre/../lib/i386
        /home/shackle/rcslib//lib/
        /usr/local/jdk1.8.0_25/jre/lib/i386/client/

        .
        /usr/local/lib
        /local/lib/
        /usr/java/packages/lib/i386
        /lib
        /usr/lib
    java.runtime.name = Java(TM) SE Runtime Environment
    java.runtime.version = 1.8.0_60-b27
    java.specification.name = Java Platform API Specification
    java.specification.vendor = Oracle Corporation
    java.specification.version = 1.8
    java.vendor = Oracle Corporation
    java.vendor.url = http://java.oracle.com/
    java.vendor.url.bug = http://bugreport.sun.com/bugreport/
    java.version = 1.8.0_60
    java.vm.info = mixed mode
    java.vm.name = Java HotSpot(TM) Server VM
    java.vm.specification.name = Java Virtual Machine Specification
    java.vm.specification.vendor = Oracle Corporation
    java.vm.specification.version = 1.8
    java.vm.vendor = Oracle Corporation
    java.vm.version = 25.60-b23
    line.separator = \n 
    os.arch = i386
    os.name = Linux
    os.version = 3.2.0-32-generic
    path.separator = :
    sun.arch.data.model = 32
    sun.boot.class.path = /usr/local/jdk1.8.0_60/jre/lib/resources.jar
        /usr/local/jdk1.8.0_60/jre/lib/rt.jar
        /usr/local/jdk1.8.0_60/jre/lib/sunrsasign.jar
        /usr/local/jdk1.8.0_60/jre/lib/jsse.jar
        /usr/local/jdk1.8.0_60/jre/lib/jce.jar
        /usr/local/jdk1.8.0_60/jre/lib/charsets.jar
        /usr/local/jdk1.8.0_60/jre/lib/jfr.jar
        /usr/local/jdk1.8.0_60/jre/classes
    sun.boot.library.path = /usr/local/jdk1.8.0_60/jre/lib/i386
    sun.cpu.endian = little
    sun.cpu.isalist = 
    sun.desktop = gnome
    sun.io.unicode.encoding = UnicodeLittle
    sun.java.launcher = SUN_STANDARD
    sun.jnu.encoding = UTF-8
    sun.management.compiler = HotSpot Tiered Compilers
    sun.os.patch.level = unknown
    user.country = US
    user.dir = /home/shackle/NetBeansProjects/CppApplication_2
    user.home = /home/shackle
    user.language = en
    user.name = shackle
    user.timezone = 

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Server VM (build 25.60-b23, mixed mode)
shackle@shackle-desktop:~/NetBeansProjects/CppApplication_2$