0

I have a JavaFX project in Intellij and I need to import an external library (jfxtras, which will give me JavaFX add-ons). After going to File -> Project Structure -> SDKs -> Classpath and adding the jar file for jfxtras, Intellij doesn't recognize the import statement for jfxtras and the code doesn't complile.

There is no package statement at the top of the file; I was wondering if this may have anything to do with it. The code compiles before typing the import statement and without any package statement.

  • 1
    Java doesn't support importing classes from the default package: https://stackoverflow.com/a/2193298/104891. – CrazyCoder Jul 06 '17 at 16:29
  • Thanks - so the fix is to create my own package and then import – Rishi Pochiraju Jul 06 '17 at 16:31
  • Even after creating my own package, I could not import classes – Rishi Pochiraju Jul 06 '17 at 16:50
  • 1
    The package must be defined in the jar and the jar must be added to the [module dependencies](https://www.jetbrains.com/help/idea/2017.1/working-with-module-dependencies.html). In case the issue persists, please share the [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve). – CrazyCoder Jul 06 '17 at 16:51

0 Answers0