JDK/JRE source code with matching JSSE (SSL) source code and matching runnable JDK / JRE?

后端 未结 8 1075
庸人自扰
庸人自扰 2021-02-05 20:30

I have seen Where to find Java 6 JSSE/JCE Source Code? and asked the question myself How to get JRE/JDK with matching source? but I don\'t either of these was specific enough

8条回答
  •  忘了有多久
    2021-02-05 20:43

    You can get the source code of JSSE lib (Open JDK implementation) here - http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/4d6c03fb1039/src/share/classes/sun/security/ssl

    Steps to create a source jar file for attaching to an IDE for debugging.

    1. Go a little above in the directory structure i.e. to http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/file/4d6c03fb1039/src/share/classes/ repo.
    2. Download the source package by clicking on the "zip" or "gz" links that you see at the left pane.
    3. But this package is huge and contains thousands of *.java files. You do not normally want all of these to just debug jsse.jar code.
    4. So better copy only the sun.security.rsa , sun.security.ssl , sun.security.provider & com.sun.net.ssl packages to a new folder (lets say jsse-code) on your computer.
    5. Go to that folder from command line & create the source jar on your own.
      e.g. jar -cvf jsse-src.jar *
    6. You are done. You now have your jsse source lib that you can attach to your preferred IDE (e.g. - Eclipse) to debug the JSSE code.

    Thanks
    Ayas

提交回复
热议问题