0

I installed Java SE 14 and Eclipse IDE. Now I want to access the Java official documentation from the Eclipse IDE itself. How do I achieve this?

Note : I looked this question. I found out that adding src.zip to the jre library in eclipse will work. But I didn't find src.zip in my jdk-14.0.1 folder. May be the recent versions didn't include src.zip.

Other details :

  • Downloaded Java from here
  • Windows 10
  • Eclipse IDE 2020-06 edition
  • how did you install jdk 14? – Joni Jul 07 '20 at 12:43
  • For the Linux version, it's in the `lib` subfolder. – tobias_k Jul 07 '20 at 12:53
  • What OS are you using? –  Jul 07 '20 at 12:58
  • @tobias_k On Linux it's there only if the `openjdk-src` package (or whatever the name is, depending on the distro) it's been installed. –  Jul 07 '20 at 13:17
  • (I was referring to when downloading from https://jdk.java.net/ ) – tobias_k Jul 07 '20 at 13:21
  • 2
    Which Eclipse version do you have exactly (see _Help > About Eclipse IDE_)? Configuring the JDK in _Window > Preferences: Java > Installed JREs_ should be enough to use it in projects and to see the source code of the system library. – howlger Jul 07 '20 at 13:28

2 Answers2

1

Open your eclipse IDE and go to

windows option -> show view -> javadoc

after choosing that you can view a Javadoc tab in the below panel. Like this enter image description here Initially, it will be blank. when you choose a library function you can view the official Javadoc details in this panel. You need not download or configure any source file for this.

Zia
  • 195
  • 1
  • 8
  • It didn't work. When I viewed the details of a library method in javadoc it displayed "Note: This element neither has attached source nor attached Javadoc and hence no Javadoc could be found." – Shashikanth Reddy Jul 07 '20 at 14:03
  • 1
    This blog discusses the solutions to fix the above error you reported.https://crunchify.com/in-eclipse-how-to-fix-this-element-neither-has-attached-source-nor-attached-javadoc-and-hence-no-javadoc-could-be-found/ – Zia Jul 07 '20 at 14:14
  • 1
    https://stackoverflow.com/questions/6406300/how-to-view-javadoc-in-eclipse please go through this. It might help you. – Zia Jul 08 '20 at 05:56
  • You are right. I need not configure any source file. I was able to solve my problem when I reinstalled jdk. – Shashikanth Reddy Jul 11 '20 at 14:31
0

I am not sure why I cannot find src.zip in the jdk installation directory. So I reinstalled it. When I reinstalled the jdk 14 I found the src.zip in that directory. Here is the path of that folder : C:\Program Files\Java\jdk-14.0.1\lib\src.

And it is not even required for me to attach this source to the eclipse. Eclipse automatically detected the source and attached it.