eclipse中查看源代码
  TEZNKK3IfmPf 2023年11月14日 34 0

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

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

2.步骤

点击window->perferences->java->Installed->JRE,然后双击你的JRE
eclipse中查看源代码
然后就选择rt.jar的那个,
eclipse中查看源代码
死的,就是这么简单,但是我刚开始选择了External Folder 并没有出现src.zip,
之后就选择了上面的External File , JDK 下的src.zip出现了。
eclipse中查看源代码
操作完成之后,我就开始愉快的看源码了。快捷键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 */
            }
        }
    }
【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月14日 0

暂无评论

推荐阅读
  TEZNKK3IfmPf   2023年11月14日   35   0   0 eclipse
TEZNKK3IfmPf