0

I want to see JavaFX types' javadocs in IntelliJ IDEA.

To do that, I need to download the sources and specify the zip in the sourcepath (Project Structure - SDKs - Sourcepath). I did it.

However, once I navigate to any JavaFX type, the IDE says:

Library source does not match the bytecode for class [class name]

It seems the sources are for a different version than the one bundled in the Liberica JDK 8 that we use (jre\lib\ext\jfxrt.jar).

I tried the following versions: 8, 2.1, 2.2. The message persists.

Where do I find the sources for the bundled JavaFX?

4
  • Windows IDEA or Linux IDEA ?Liberica JDK 8 is bellsoft-jdk8u462+11-linux-amd64-full.tar.gz or others ? Commented yesterday
  • Ideally, I would expect Liberica JDK to include the JavaFX sources in the src.zip file that ships with the JDK. Or perhaps a separate ZIP file named something like javafx-src.zip. Does it not do that? Commented yesterday
  • @Slaw nope, it does not. It only includes the class files for JavaFX, not the sources Commented yesterday
  • @life888888 jdk8u282-full, Windows Commented yesterday

1 Answer 1

5

Download JDK And Source Files

https://bell-sw.com/pages/downloads/#jdk-8-lts

enter image description here

Windows - Liberica Standard JDK 8u462+11 x86 64 for Windows

  • Select Full JDK
  • ZIP
  • Source code

Note: The JDK and Source files you download must be of the same version.

Files:

  • JDK With JavaFX - bellsoft-jdk8u462+11-windows-amd64-full.zip
  • Source File - bellsoft-jdk8u462+11-src-full.tar.gz

Examples

D:\WK

Create Project

demofx8 in D:\WK\demofx8

  • Put JDK And Source in D:\WK
D:\WK
├── bellsoft-jdk8u462+11-windows-amd64-full.zip
├── bellsoft-jdk8u462+11-src-full.tar.gz
└── demofx8
  • Unzip JDK zip (bellsoft-jdk8u462+11-windows-amd64-full.zip)
  • Unzip Source zip (bellsoft-jdk8u462+11-src-full.tar.gz)

Note: The source archive (bellsoft-jdk8u462+11-src-full.tar.gz) is a tar.gz file that needs to be unpacked using a tool like 7z.

D:\WK
├── bellsoft-jdk8u462+11-windows-amd64-full.zip
├── bellsoft-jdk8u462+11-windows-amd64-full
│   └── jdk8u462-full <--- JDK DIR
├── bellsoft-jdk8u462+11-src-full.tar.gz
├── jdk-8u462-full    <--- SOURCE DIR
└── demofx8

ADD New JDK

Menu: File -> Project Structure...

enter image description here

  • Platform Settings -> SDKs
  • + -> Add New SDK

enter image description here

  • Add JDK from disk...

enter image description here

select JDK DIR

D:\WK
└── bellsoft-jdk8u462+11-windows-amd64-full
     └── jdk8u462-full

enter image description here

Success , JDK name is liberica-1.8

ADD Source

enter image description here

Tab: Sourcepath ,

  • + -> Add

enter image description here

select SOURCE DIR

D:\WK
└── jdk8u462-full

enter image description here

Click OK

enter image description here

Add Source OK.

Change Project SDK

enter image description here

SDK: drop down, select liberica-1.8

enter image description here

Select FXMLLoader, it will show doc api hint , and jump source

enter image description here

now, IDEA open FXMLLoader.java

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.