Skip to content

Commit

Permalink
Upgrade to Java 17
Browse files Browse the repository at this point in the history
Java 17 is the latest LTS version of Java and comes with convenience
APIs and performance improvements. Changes to get it working:
- the Launch4j Maven plugin had to be upgraded. The new version has JRE
 path as a required option. Setting it to "jre" preserves the previous
 behavior of using the host's bundled JRE is preserved.
- a dependency of appbundle-maven-plugin had to be upgraded
- the Netty dependency could be removed, it was completely unused
  • Loading branch information
StenAL committed Apr 28, 2023
1 parent 2be2b7f commit dc8b995
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: 17
distribution: 'temurin'
# Step that caches and restores maven dependencies
- name: Cache maven dependencies
uses: actions/cache@v2
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ jobs:
uses: metcalfc/[email protected]
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 1.8
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: 17
distribution: 'temurin'
# Step that caches and restores maven dependencies
- name: Cache maven dependencies
uses: actions/cache@v2
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ The Java Applet-based Minigolf Client was one of the most popular multiplayer ga

### Prerequisites
- Clone this repo: `git clone [email protected]:PhilippvK/playforia-minigolf.git`
- Install Java Development Kit 8 (https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
* OpenJDK1.8 should work as well!
- Install Java Development Kit 17 (https://adoptium.net/en-GB/temurin/releases/)
- Install Apache `maven` for building: https://maven.apache.org/install.html
- *Optional:* Install IntelliJ IDEA Java IDE (https://www.jetbrains.com/idea/download/) and import this reposiory as project
- *Optional:* Install IntelliJ IDEA Java IDE (https://www.jetbrains.com/idea/download/) and import this reposiory as project

### Building

Expand Down Expand Up @@ -74,9 +73,8 @@ If you want to enable debugging messages, add `--verbose` to the list of argumen
## Compability

Tested:
- MacOS 10.14.5 Mojave with Java Version `1.8.0_152-ea` with (Open)JDK
- Ubuntu 19.04 with Java version `1.8.0_265`
- Windows (7/8/10)
- Ubuntu 22.04 with Java version `17.0.6`
- Windows 10/11

## Problems
- Ratings are not synced
Expand Down
27 changes: 15 additions & 12 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,11 @@
<project.mainClass>org.moparforia.client.Launcher</project.mainClass>
<project.name>Playforia Minigolf Client</project.name>
<project.download.directory>${project.build.directory}/downloads</project.download.directory>
<project.jre.osx.link>https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u252-b09.1/OpenJDK8U-jre_x64_mac_hotspot_8u252b09.tar.gz</project.jre.osx.link>
<project.jre.osx.name>jdk8u252-b09-jre</project.jre.osx.name>
<project.jre.osx.link>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.7%2B7/OpenJDK17U-jre_x64_mac_hotspot_17.0.7_7.tar.gz</project.jre.osx.link>
<project.jre.osx.name>jdk-17.0.7+7-jre</project.jre.osx.name>
</properties>

<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
Expand Down Expand Up @@ -89,7 +84,7 @@
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.3.0</version>
<version>1.6.8</version>
<executions>
<execution>
<id>download-osx-jre</id>
Expand Down Expand Up @@ -126,12 +121,19 @@
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
</plugin>

<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.25</version>
<version>2.3.3</version>
<executions>
<execution>
<id>windows-build</id>
Expand All @@ -143,15 +145,16 @@
<headerType>gui</headerType>
<jar>${project.build.directory}/${project.artifactId}-${project.version}.jar</jar>
<outfile>${project.build.directory}/${project.artifactId}-${project.version}.exe</outfile>
<downloadUrl>http://java.com/download</downloadUrl>
<downloadUrl>https://adoptium.net/en-GB/temurin/releases/</downloadUrl>
<!-- Make sure to enable JavaSoft (Oracle) registry keys during installation, otherwise the exe won't detect the JRE -->
<classPath>
<mainClass>${project.mainClass}</mainClass>
<preCp>anything</preCp>
</classPath>
<icon>src/main/resources/icons/playforia.ico</icon>
<jre>
<minVersion>1.8.0</minVersion>
<jdkPreference>preferJre</jdkPreference>
<path>jre</path>
<minVersion>17</minVersion>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit dc8b995

Please sign in to comment.