Skip to content

Commit

Permalink
Upgrade JavaFX to ver 17
Browse files Browse the repository at this point in the history
The application uses JavaFX 11 which is reaching its EOL in September
2023. Thus it is better to upgrade JavaFX to the next LTS version which
is version 17.

However, after version 16, JavaFX now throws a warning when JavaFX
modules are loaded from the classpath. As there is currently no plan to
migrate to using Modules in AB3, let's include an additional log message
to inform the users to ignore the warning message.
  • Loading branch information
Eclipse-Dominator committed Jul 3, 2023
1 parent 9356ae9 commit 8d4c9aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ task coverage(type: JacocoReport) {

dependencies {
String jUnitVersion = '5.4.0'
String javaFxVersion = '11.0.2'
String javaFxVersion = '17.0.7'

implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'win'
implementation group: 'org.openjfx', name: 'javafx-base', version: javaFxVersion, classifier: 'mac'
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/seedu/address/Main.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package seedu.address;

import java.util.logging.Logger;

import javafx.application.Application;
import seedu.address.commons.core.LogsCenter;

/**
* The main entry point to the application.
Expand All @@ -19,7 +22,19 @@
* to be the entry point of the application, we avoid this issue.
*/
public class Main {
private static Logger logger = LogsCenter.getLogger(Main.class);
public static void main(String[] args) {
/**
* Since JavaFX 16, JavaFX runtime logs a warning if javafx.* modules are loaded from the classpath.
* This will result in a warning message whenever the application is launched.
* As modules are ignored when packed into a FAT Jar file, this warning will always be shown regardless
* of whether the application is using modules or not.
*
* This warning however, can be safely ignored. Thus, this log is used to inform the user that the warning
* can be ignored.
* https://github.com/openjdk/jfx/blob/master/doc-files/release-notes-16.md
*/
logger.info("The warning about Unsupported JavaFX configuration below can be ignored.");
Application.launch(MainApp.class, args);
}
}

0 comments on commit 8d4c9aa

Please sign in to comment.