1

I am a java developer just recently coming to the stack. I am very interested on how some of these classes are implemented and know that it is possible to install the source code within the eclipse viewer (shit-cntrl-t).

Im getting a strange error while trying to browse the source

"The source attachment does not contain the source for the file PrintColor.class. You can change the source attachment by clicking Change Attached source below".

Problem is, I have the path to the jdk source code where it should be.

Anybody have any ideas?

  • What's the fully qualified type name for PrintColor? Does it actually come from the JDK? – nitind Sep 02 '18 at 23:05
  • Hmm..yes, now that you mention it, I've browsed other class files (like arraylist) and they show up fine. For some reason, the PrintColor class doesn't exist but many others do. If you can explain why this one isn't available, that would be great, otherwise I have a bunch of new methods and implementations to explore at will! – Chris Gauthier Winnipeg Sep 02 '18 at 23:18
  • Version numbers would help figure it out. – nitind Sep 02 '18 at 23:19
  • Version numbers...ok. Eclipse Photon 4.8.0 and jdk 1.8.0_181. Im just looking to figure out (for academic reasons) why some classes don't show up with source code and some do. – Chris Gauthier Winnipeg Sep 02 '18 at 23:57
  • @ChrisGauthierWinnipeg Since _PrintColor_ is part of JavaFX this may help you: [How to attach source or JavaDoc in eclipse for any jar file e.g. JavaFX?](https://stackoverflow.com/q/9870448/2985643). The file **javafx-src.zip** should be under the root of your installation of jdk 1.8.0_181. If the Class (or Enum in this case) of the thing you want to view the source for is not part of the Javadoc for Java 8 I suspect you are probably going to have to add the source zip manually in Eclipse. – skomisa Sep 03 '18 at 05:53
  • Great, that solves that! Thank you. – Chris Gauthier Winnipeg Sep 03 '18 at 13:26

0 Answers0