1

I want to see the source of class and know how it is work and implement.

When I hold ctrl & click on class that I want to see the source of class I got this:

screen shoot image of problem

I do not have any idea about this and I tried to search for problem but I couldn't find anything. Could I get some help with this?

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701
ali shreef
  • 69
  • 10
  • 1
    The error is pretty clear; the source for javafx isn't included in your jar file. You can get the source [here](http://hg.openjdk.java.net/openjfx/8/master/rt). – Elliott Frisch Aug 09 '16 at 03:32
  • i know that but how to fix that from linke ?? by the way i install jdk8 !!! – ali shreef Aug 09 '16 at 03:37
  • 1
    download the source as pointed by "Frisch" and click "attach source" and then provide the like of source file downloaded – ravthiru Aug 09 '16 at 03:39
  • i download the files in zip format and add to project then i attached it to source but it say the file not contain the source class ???? – ali shreef Aug 09 '16 at 03:48

1 Answers1

0

Eclipse (and any other IDE) can only show you source code for external libraries if that source actually is around locally.

In other words: within your project setup, you define libraries and JRE/JDK runtime environments that should be used for your project. Typically, the JARs that come with JREs/JDKs will come with "source code attached"; but if not, you have to do two things:

  1. Obtain the corresponding source code archive from somewhere; most of the time, they are already on your system (because they are typically part of the product you are using; either JDK or 3rd party library).
  2. Then you have to tell eclipse where to find that source code.

In your case: the JavaFX source code might be distributed with your JDK. You simply need to select the corresponding zip file using the standard "Attach Source" approach. So, first check if you can find the file javafx-src.zip on your local system; if not; turn here.

Community
  • 1
  • 1
GhostCat
  • 137,827
  • 25
  • 176
  • 248
  • thank's it's work i download the zip file and clicked attach file then extra path and select zip file and work . Elliott Frisch thank's also your way like ghostCat but i do not get it clearly because ghost explain very well thank's to all – ali shreef Aug 09 '16 at 04:54