eclipse中查看源代码

今天学习线程的时候,想查看start()方法的源码就是下载不下来,无奈网上百度了下,找到了解决的方式:

1.如何在ecplise中查看源代码的尼

2.步骤

点击window->perferences->java->Installed->JRE,然后双击你的JRE
eclipse中查看源代码_第1张图片
然后就选择rt.jar的那个,
eclipse中查看源代码_第2张图片
死的,就是这么简单,但是我刚开始选择了External Folder 并没有出现src.zip,
之后就选择了上面的External File , JDK 下的src.zip出现了。
eclipse中查看源代码_第3张图片
操作完成之后,我就开始愉快的看源码了。快捷键F3,也可以使用Ctrl+鼠标

 public synchronized void start() {
        /**
         * This method is not invoked for the main method thread or "system"
         * group threads created/set up by the VM. Any new functionality added
         * to this method in the future may have to also be added to the VM.
         *
         * A zero status value corresponds to state "NEW".
         */
        if (threadStatus != 0)
            throw new IllegalThreadStateException();

        /* Notify the group that this thread is about to be started
         * so that it can be added to the group's list of threads
         * and the group's unstarted count can be decremented. */
        group.add(this);

        boolean started = false;
        try {
            start0();  //此处是重点
            started = true;
        } finally {
            try {
                if (!started) {
                    group.threadStartFailed(this);
                }
            } catch (Throwable ignore) {
                /* do nothing. If start0 threw a Throwable then
                  it will be passed up the call stack */
            }
        }
    }

你可能感兴趣的:(项目中配置及报错解决方案,源代码查看,eclipse,F3,jre)