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 10, 2023
1 parent c9c9512 commit eb52f56
Show file tree
Hide file tree
Showing 2 changed files with 17 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
16 changes: 16 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,20 @@
* 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) {
/*
* As per https://github.com/openjdk/jfx/blob/master/doc-files/release-notes-16.md
* JavaFX 16 (or later) runtime logs a warning at startup if JavaFX classes are loaded from
* the classpath instead of a module.
* Our application does not use Java modules yet. Even if it did, modules are ignored when
* packed into a FAT Jar file (as we do), which means this warning will persist even then.
* The warning however, can be safely ignored. Thus, the following log informs
* the user (if looking at the log output) that the said warning appearing in the log
* can be ignored.
*/
logger.info("The warning about Unsupported JavaFX configuration below can be ignored.");
Application.launch(MainApp.class, args);
}
}

0 comments on commit eb52f56

Please sign in to comment.