JavaFX source code not showing

前端 未结 3 1405
南旧
南旧 2020-12-01 19:15

I downloaded the JavaFx source code from http://hg.openjdk.java.net/openjfx/2.2/master/rt/summary.

The name of the folder in the zip file is re-e71070b0e0c0

相关标签:
3条回答
  • 2020-12-01 19:37

    I've faced this problem on Ubuntu 16.04 with JavaFX 8 (open-jfx package). The fix was to install the missing source package:

    sudo apt install openjfx-source
    

    IntellJ started showing JavaFX source code the second after the command finished executing.

    0 讨论(0)
  • 2020-12-01 19:50

    (Since this is one of the Google hits for "javafx source code", I'll dump this anwer here too):

    Quoting from this answer: For Java 8, the source of the public parts of JavaFX are actually laying right along in the JDK installation as a sibling of src.zip: javafx-src.zip - on the root of your normal JDK Java 8 installation.

    Eclipse doesn't by default link them up when you add the JRE (or it finds it itself) - obviously a bug - so you'll have to do that yourself, by hitting Preferences -> Installed JREs. Find your JDK 8, hit Edit button. On the list JRE system libraries, expand the jfxrt.jar node, and link in the javafx-src.zip file.

    0 讨论(0)
  • 2020-12-01 19:53

    These instructions are only necessary for the JavaFX 2.x branch and will be obsoleted once JDK 8 is released.

    After you have downloaded the source zip and extracted it, open Idea and follow these instructions:

    1. Modify the source structure for your 1.7 SDK:

      File | Project Structure | SDKs | Sourcepath

      For each sub-project in the extracted zip, type Alt+Insert and add the respective source directory. For example rt-e71070b0e0c0\javafx-ui-charts\src, rt-e71070b0e0c0\javafx-ui-common\src, etc. Not all JavaFX 2.x source code is currently open sourced, so this will only add the open sourced portions.

    2. Set the documentation lookup path:

      File | Project Structure | SDKs | Documentation Paths

      Specify a url Alt+S for the documentation: http://docs.oracle.com/javafx/2/api/

    3. In your JavaFX application source, place your cursor over a JavaFX class usage, for instance LineChart:

      1. Press Ctrl+B to open the source code file LineChart.java from your downloaded zip.
      2. Press Shift+F1 to open documentation on the LineChart in a browser.
      3. Press Ctrl+Q to get quick access to documentation from in the IDE.

    Update Oct 16 2013

    JDK 8 now includes JavaFX source files.

    To tell Idea where JavaFX sources are:

    1. Modify the source structure for your 1.8 SDK:

      File | Project Structure | SDKs | Sourcepath

      Press Alt+S to add the file javafx-src.zip, which is located in the root directory of the JDK 8 distribution.

    2. Set the documentation lookup path:

      File | Project Structure | SDKs | Documentation Paths

      Specify a url Alt+S for the documentation: http://download.java.net/jdk8/jfxdocs.

      The JDK 8 JavaFX documentation url will likely change when JDK 8 reaches General Availability release stage.

    Step 3 above provides keyboard shortcuts to quickly access the JavaFX sources and documentation from your project.

    0 讨论(0)
提交回复
热议问题