view java source code

前端 未结 6 2000
Happy的楠姐
Happy的楠姐 2020-12-08 21:41

Is any way to view the actual code behind the default classes in Java (java.awt.*;, javax.swing.*;, etc) to see exactly what it is that is

6条回答
  •  伪装坚强ぢ
    2020-12-08 22:04

    For those who use linux distributions, like ubuntu, archlinux, etc. You can always get openjdk source code via corresponding package management system. This means you can choose a faster mirror to get the source code.

    For ubuntu users:

    $ sudo apt-get install openjdk-7-source
    

    For Archlinux users:

    $ sudo pacman -S openjdk7-src
    

    The source will be located in the $JAVA_HOME, somewhere like /usr/lib/jvm/java-7-openjdk/src.zip.

    Other distributions will have likewise package names, so not listed here.

提交回复
热议问题