Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Advanced: Build and run using IntelliJ IDEA

In “Step 2: Setup the build system: JDK and Gradle”, IntelliJ was configured to use Gradle as tool for launching JabRef. It is also possible to use IntelliJ’s internal build and run system to launch JabRef. Due to IDEA-119280, it is a bit more work.

  1. Navigate to File > Settings… > Build, Execution, Deployment > Build Tools > Gradle.
  2. Change the setting “Build and run using:” to “IntelliJ IDEA”.
  3. Navigate to File > Settings… > Build, Execution, Deployment > Compiler > Java Compiler.
  4. Uncheck --Use 'release' option for cross-compilation.
  5. Build > Build Project
  6. Open the project view (Alt+1, on macOS cmd+1)
  7. Copy all build resources to the folder of the build classes
    1. Navigate to the folder build/resources/main
    2. Right click -> “Open In” -> “Explorer (Finder on macOS)”
    3. Navigate into directory “main”
    4. Select the folder out/production/classes
    5. Right click -> “Open In” -> “Explorer (Finder on macOS)”
    6. Navigate into directory “classes”
    7. Now you have two Explorer windows opened. Copy all files and directories from the first one to the second one.
  8. Locate the class Launcher (e.g., by ctrl+N and then typing Launcher). Press Enter to jump to that class.
    IntelliJ search for class “Launcher”
    IntelliJ search for class “Launcher”
  9. Click on the green play button next to the main method to create a Launch configuration. IntelliJ will fail in launching.
    However on green play
    However on green play
    Run JabRef via launcher
    Run JabRef via launcher
  10. On the top right of the IntelliJ window, next to the newly created launch configuration, click on the drop down
  11. Click on “Edit Configurations…”
  12. On the right, click on “Modify options”
  13. Ensure that “Use classpath of module” is checked
  14. Select “Add VM options”
  15. In the newly appearing field for VM options, insert:
       --add-exports javafx.controls/com.sun.javafx.scene.control=org.jabref
       --add-exports org.controlsfx.controls/
       --add-exports javafx.controls/com.sun.javafx.scene.control.behavior=org.controlsfx.controls
       --add-exports javafx.controls/com.sun.javafx.scene.control=org.controlsfx.controls
       --add-exports javafx.controls/com.sun.javafx.scene.control.inputmap=org.controlsfx.controls
       --add-exports javafx.base/com.sun.javafx.event=org.controlsfx.controls
       --add-exports javafx.base/com.sun.javafx.collections=org.controlsfx.controls
       --add-exports javafx.base/com.sun.javafx.runtime=org.controlsfx.controls
       --add-exports javafx.web/com.sun.webkit=org.controlsfx.controls
       --add-reads org.jabref=org.fxmisc.flowless
       --add-reads org.jabref=org.apache.commons.csv
  16. Click “Apply”
  17. Click “Run”. You can also click on the debug symbol next to it to enable stopping at breakpoints.
    Launch menu contains “Launcher”
    Launch menu contains “Launcher”