How do I add the Java API documentation to Eclipse?

前端 未结 14 1610
名媛妹妹
名媛妹妹 2020-11-30 17:34

I have downloaded Java API documentation from http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs and have supposedly attached it to Eclipse using the

14条回答
  •  悲哀的现实
    2020-11-30 18:07

    For OpenJDK 8 on Linux see: https://askubuntu.com/questions/755853/how-to-install-jdk-sources

    The way that worked for me is:

    • The default src.zip is a symbolic link pointing to a non-existing folder ...
    • sudo apt-get install openjdk-8-source this adds this folder
    • locate "src.zip"
    • Eclipse: Window --> Preferences --> Java --> "Installed JREs", edit and point to src.zip (or open any JRE class like for example HashMap and attach source)

    You should now see the JavaDoc when opening JRE classes via Ctrl+Shift+t, previously this was not possible, Eclipse may have got a docs from the default URL on mouse over methods but this requires a stable internet connection.

提交回复
热议问题