Skip to content

Commit

Permalink
Move back to JDK 8
Browse files Browse the repository at this point in the history
We currently advertise that we support "JDK 9 and above". However,

  * JDK 9 and JDK 10 are no longer readily downloadable from Oracle's
    website as they have "reached end of support"[1][2],

  * JDK 10 on Windows will crash when running tests in headless mode due
    to a JavaFX bug[3],

  * JDK 11 and above can't be easily used with our project as JavaFX is
    not distributed with Oracle JDK 11 and above anymore[4].

As these issues will likely not be resolved anytime soon, let's
temporarily downgrade our project to JDK 8 for now, since it is stil
available on Oracle's website, at least until the end of January.

The commits which upgraded our project from JDK 8 to JDK 9+ are:

  * 889a105 (build.gradle: upgrade to use Java 9, 2018-03-01)

  * 544d89b (Warn developers against using JDK 10 on Windows,
    2018-06-30)

  * 5383298 (DeveloperGuide: update "Setting up" section, 2018-09-08),
    which is only applicable with JDK 9 and above since it deals with
    the Java module system.

So let's revert them, with the following exceptions:

  * We keep the TestFX version at our current version (4.0.12-alpha),
    since it supports JDK 8.

  * We use openjfx-monocle version 8u76-b04 since that is the latest
    version of openjfx-monocle that supports JDK 8.

  * We do not revert the changes 889a105 made to gradle.properties,
    since the changes were to remove flags that were already deprecated
    in JDK 8.

  * We keep the minimum Java version at `1.8.0_201` (the lowest version
    available on Oracle's JDK 8 download page[5]), since we have not
    tested the current code base with JDK 8 versions lower than that.

  * We make it clear in the User Guide / Developer Guide that we only
    support JDK 8 (not JDK 9, 10, 11 etc.)

[1] https://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html
[2] https://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html
[3] See 544d89b (Warn developers against using JDK 10 on Windows,
    2018-06-30)
[4] "Starting with JDK 11, Oracle is making JavaFX easier to adopt by
    making the technology available as a separate download, decoupled
    from the JDK."
     -- https://blogs.oracle.com/java-platform-group/the-future-of-javafx-and-other-java-client-roadmap-updates
[5] https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  • Loading branch information
pyokagan committed Jan 25, 2019
1 parent f7c0be2 commit 3605c4d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: java
matrix:
include:
- jdk: oraclejdk9
- jdk: oraclejdk8

script: >-
./config/travis/run-checks.sh &&
Expand All @@ -17,7 +17,7 @@ deploy:
addons:
apt:
packages:
- oracle-java9-installer
- oracle-java8-installer

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_script:
- gradlew.bat --no-daemon headless allTests

environment:
JAVA_HOME: C:\Program Files\Java\jdk9 # Use 64-bit Java
JAVA_HOME: C:\Program Files\Java\jdk1.8.0 # Use 64-bit Java

# Files/folders to preserve between builds to speed them up
cache:
Expand Down
24 changes: 4 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,11 @@ plugins {
id 'application'
}

if (JavaVersion.current() == JavaVersion.VERSION_1_10
&& System.getProperty('os.name').startsWith('Windows')) {
logger.warn('''\
==============================================================================
*********************************** WARNING **********************************
==============================================================================
You seem to be running Gradle with JDK 10 on Windows.
JDK 10 on Windows will fail to run tests in headless mode due to a JavaFX bug.
You are highly recommended to use JDK 9!
==============================================================================
'''.stripIndent())
}

// Specifies the entry point of the application
mainClassName = 'seedu.address.MainApp'

sourceCompatibility = JavaVersion.VERSION_1_9
targetCompatibility = JavaVersion.VERSION_1_9
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
mavenCentral()
Expand Down Expand Up @@ -63,15 +50,12 @@ dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '19.0'

testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.testfx', name: 'testfx-core', version: testFxVersion, {
exclude group: 'org.testfx', module: 'testfx-internal-java8'
}
testImplementation group: 'org.testfx', name: 'testfx-core', version: testFxVersion
testImplementation group: 'org.testfx', name: 'testfx-junit', version: testFxVersion

testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: jUnitVersion

testRuntimeOnly group: 'org.testfx', name: 'testfx-internal-java9', version: testFxVersion
testRuntimeOnly group: 'org.testfx', name: 'openjfx-monocle', version: 'jdk-9+181'
testRuntimeOnly group: 'org.testfx', name: 'openjfx-monocle', version: '8u76-b04'
testRuntimeOnly group:'org.junit.vintage', name:'junit-vintage-engine', version: jUnitVersion
testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: jUnitVersion
}
Expand Down
17 changes: 6 additions & 11 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:warning-caption: :warning:
:experimental:
endif::[]
:repoURL: https://github.com/se-edu/addressbook-level4/tree/master

Expand All @@ -21,12 +20,12 @@ By: `Team SE-EDU`      Since: `Jun 2016`      Licence: `MIT`

=== Prerequisites

. *JDK `9`* or later
. *JDK `8`* (revision `1.8.0_201` or later)
+
[NOTE]
Only JDK 8 is supported. +
This app will not work with later major JDK releases such as JDK 9, 10, 11, etc.
+
[WARNING]
JDK `10` on Windows will fail to run tests in <<UsingGradle#Running-Tests, headless mode>> due to a https://github.com/javafxports/openjdk-jfx/issues/66[JavaFX bug].
Windows developers are highly recommended to use JDK `9`.

. *IntelliJ* IDE
+
[NOTE]
Expand All @@ -47,10 +46,6 @@ Do not disable them. If you have disabled them, go to `File` > `Settings` > `Plu
. Click `OK` to accept the default settings
. Open a console and run the command `gradlew processResources` (Mac/Linux: `./gradlew processResources`). It should finish with the `BUILD SUCCESSFUL` message. +
This will generate all resources required by the application and tests.
. Open link:{repoURL}/src/main/java/seedu/address/ui/MainWindow.java[`MainWindow.java`] and check for any code errors
.. Due to an ongoing https://youtrack.jetbrains.com/issue/IDEA-189060[issue] with some of the newer versions of IntelliJ, code errors may be detected even if the project can be built and run successfully
.. To resolve this, place your cursor over any of the code section highlighted in red. Press kbd:[ALT + ENTER], and select `Add '--add-modules=...' to module compiler options` for each error
. Repeat this for the test folder as well (e.g. check link:{repoURL}/src/test/java/seedu/address/ui/HelpWindowTest.java[`HelpWindowTest.java`] for code errors, and if so, resolve it the same way)

=== Verifying the setup

Expand Down Expand Up @@ -878,7 +873,7 @@ _{More to be added}_
[appendix]
== Non Functional Requirements

. Should work on any <<mainstream-os,mainstream OS>> as long as it has Java `9` or higher installed.
. Should work on any <<mainstream-os,mainstream OS>> as long as it has Java `8` (revision `1.8.0_201` or higher) installed.
. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage.
. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse.

Expand Down
7 changes: 6 additions & 1 deletion docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ AddressBook Level 4 (AB4) is for those who *prefer to use a desktop app for mana

== Quick Start

. Ensure you have Java version `9` or later installed in your Computer.
. Ensure you have Java `8` (revision `1.8.0_201` or later) installed in your Computer.
+
[NOTE]
Only Java 8 is supported. +
This app will not work with later major Java releases such as Java 9, 10, 11, etc.
+
. Download the latest `addressbook.jar` link:{repoURL}/releases[here].
. Copy the file to the folder you want to use as the home folder for your Address Book.
. Double-click the file to start the app. The GUI should appear in a few seconds.
Expand Down
6 changes: 0 additions & 6 deletions docs/UsingGradle.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
ifdef::env-github[]
:tip-caption: :bulb:
:note-caption: :information_source:
:warning-caption: :warning:
endif::[]

https://gradle.org/[Gradle] is a build automation tool. It can automate build-related tasks such as
Expand Down Expand Up @@ -77,7 +76,6 @@ Runs the code style check for the test code base

The set of code style rules implemented can be found in `config/checkstyle/checkstyle.xml`. To enable _exceptions_ to code styles, add in the comment `//CODESTYLE.OFF: RuleName` at the start of the section and `//CODESTYLE.ON: RuleName` at the end of the section.

[[Running-Tests]]
== Running Tests

* **`allTests`** +
Expand All @@ -89,10 +87,6 @@ Runs all non-GUI tests in the `seedu.address`
package
* **`headless`** +
Sets the test mode as _headless_. The mode is effective for that Gradle run only so it should be combined with other test tasks.
+
[WARNING]
JDK `10` on Windows will fail to run tests in headless mode due to a https://github.com/javafxports/openjdk-jfx/issues/66[JavaFX bug].
Windows developers are highly recommended to use JDK `9`.

Here are some examples:

Expand Down

0 comments on commit 3605c4d

Please sign in to comment.