问题
Firstly, I do realize this question has been asked in many permutations all over stackoverflow. I searched quite a bit before posting, so please don't link to another SO question unless it answers my specific question and scenario.
I recently upgraded from Java 8 to 10. Now, however, I cannot view source or javadocs for any Java class or library. Makes coding a lot more cumbersome.
How can I attach the source and/or javadocs for Java 10, either OpenJDK's version of it and/or Oracle's? I've read other questions' answers about needing to download them separately, opening up the Installed JREs options section in Eclipse, and manually pointing Eclipse to the source/javadocs location.
I cannot find Java 10 javadocs for download, although I was able to find the Javadoc HTML page. I cannot find specific questions about Java 10, only Java 6/7/8/9.
回答1:
I cannot find Java 10 javadocs for download
I think this one is what you're looking for:
http://www.oracle.com/technetwork/java/javase/documentation/jdk10-doc-downloads-4417029.html
回答2:
Step 1: Window --> Preferences --> Java --> "Installed JREs"
Step 2: Select the jre and click edit.
Step 3: Select as shown in the screenshot and provide the source by selecting source attachment.
Step4: Click the external file and give the source for zip file "Src" as shown below. And click ok.
Step5: Provide java doc location https://docs.oracle.com/javase/10/docs/api/ as shown below.
Step6: Click Ok and Click apply and close and you are good to go.
来源:https://stackoverflow.com/questions/51952111/how-can-i-view-java-10-javadocs-in-eclipse