Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Coffee Kata to JDK 21. #156

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Guava, Apache Commons and/or Vavr on a simple domain


## What you will need to build the katas
1. Java 17
1. Java 21
2. Maven 3.6.1+
3. IDE of your choice

Expand Down
6 changes: 3 additions & 3 deletions coffee-shop-kata-solutions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<junit5.version>5.10.0</junit5.version>
</properties>

Expand Down Expand Up @@ -70,4 +70,4 @@
</plugins>
</build>

</project>
</project>
13 changes: 6 additions & 7 deletions coffee-shop-kata/SETUP.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
## Setting up the project

### Requirements
* [JDK 20](https://jdk.java.net/20/) installed on your computer
* [JDK 21](https://jdk.java.net/21/) installed on your computer

Note: The latest version of IntelliJ only supports Java 20
* [Maven 3.6.1+](https://maven.apache.org/download.cgi) installed on your computer
* [IntelliJ IDEA 2023.1+](https://www.jetbrains.com/idea/download/?section=windows) or similar IDE for Java
* [IntelliJ IDEA 2023.2.5+](https://www.jetbrains.com/idea/download/?section=windows) or similar IDE for Java
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove the note that says the latest version of intellij only supports Java 20?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for catching that!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


### Project setup
1. Git clone the entire [code-katas](https://github.com/BNYMellon/CodeKatas) project from GitHub or download the project
as a .zip file.
2. Launch the project in the IDE and point to the pom.xml to be opened as a project.
You can find more instructions on how to do
that [here](https://www.jetbrains.com/idea/guide/tutorials/working-with-maven/importing-a-project/).
3. To use Java 20 preview features in IntelliJ IDEA, follow these steps:
3. To use Java 21 features in IntelliJ IDEA, follow these steps:
- Go to File | Project Structure.
- Set the Project SDK to 20.
- Set the Project language level to "20 (Preview)...".
- Set the Project SDK to 21.
- Set the Project language level to "21 - Record patterns, pattern matching for switch...".
- Make sure you have the correct JDK selected.
4. To verify that the Java 8 module is set up correctly,
run [CoffeeShopTest](jdk8/src/test/java/bnymellon/codekatas/coffeeshopkata/CoffeeShopTest.java) in the
Expand All @@ -26,4 +25,4 @@
jdk21 module - the class should compile but all tests will fail.

### Getting started
* Follow the [README](README.md) for instructions on how to complete the kata.
* Follow the [README](README.md) for instructions on how to complete the kata.
4 changes: 2 additions & 2 deletions coffee-shop-kata/jdk21/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<junit5.version>5.10.0</junit5.version>
</properties>

Expand Down