You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to double-click / run the command java -jar duke-0.2.jar for the JAR file that I had created using gradlew shadowJar . I am only able to right-click the JAR file and run it in IntelliJ.
I had added and removed the dependencies according to #72.
There's no error in all the steps. The JAR file just doesn't work. Why?
Code/Log Trace
Executing `gradlew run' works:
Running java -jar duke-0.2.jar command:
Right-clicking JAR file in Intellij works:
The text was updated successfully, but these errors were encountered:
id 'org.openjfx.javafxplugin' version '0.0.7' //javafx (line 6)
and javafx { version = "11.0.2" modules = [ 'javafx.controls', 'javafx.fxml' ] } (line 23-27)
they are no longer required as the JavaFX dependencies will be specified by lines 43 - 60 instead (you can also optionally choose to remove line 55 - 60 as they are unnecessary).
Your jar file generated by shadowJar should then be able to run on any system.
However, I noticed another bug during testing - your program won't launch if the file data/duke.txt is not present. You might want to look into ways to create the file automatically instead of throwing an exception and closing - see #27
Please read up on how to write a good question
Environment
Describe your development environment
Issue
Unable to double-click / run the command
java -jar duke-0.2.jar
for the JAR file that I had created usinggradlew shadowJar
. I am only able to right-click the JAR file and run it in IntelliJ.I had added and removed the dependencies according to #72.
There's no error in all the steps. The JAR file just doesn't work. Why?
Code/Log Trace
Executing `gradlew run' works:
Running
java -jar duke-0.2.jar
command:Right-clicking JAR file in Intellij works:
The text was updated successfully, but these errors were encountered: