Running project in IDEA fails due to missing resource, works with Gradle.
I'm experimenting with a simple Java 9 project and having problems with resources in IDEA. The tarball in the Dropbox link contains A skeleton that exhibits the issue. To reproduce:
Download: https://www.dropbox.com/s/i31uwob1wb0247s/work-break.tar.bz?dl=0
- mkdir test
- cd test
- tar xjvf <wherever>/work-break.tar.bz
- ./gradlew run
On both my systems, Windows 10 and OSX, this works and displays a simple rectangular window with a button using the font resource.
Next, in IDEA:
- File -> Open -> test/build.gradle
- Configure Gradle to use Java 9 (Don't know if this matters).
- Navigate to BreakView.kt
- Run the main in the bottom of the file.
- On both my systems this fails because the getResourceAsStream call at BreakView.kt::48, to load the font resource, returns null.
Next, in IDEA:
- Delete the module-info.java in codes.asm
- Run the main in BreakView.kt again
- On both my systems this behaves as ./gradlew run does, i.e. it works.
Am I missing something in my configuration here? I'm fairly new to Gradle and just toying around with Java 9 modules.
Thanks,
Andrew
Please sign in to leave a comment.