Since farmerswife version 6.8, OpenJDK is needed for your Web Server to run.
In this article, we will discuss how to replace Java (Oracle) with OpenJDK.
Why Java?
Java is used by the built-in web server and powers the Web Client and Mobile Web Client (and fw Play if licensed). Java only needs to be installed on the fw Server app host machine
Why the use of JDK?
Based on legacy requirements we keep using "JDK" (Java Development Kit) and since it's been proven to work on macOS, Windows and Linux.
You should be able to also use the slimmer "JRE" (Java Runtime Environment) if running the fw Server app host machine on Windows; if it fails to get detected by the fw Server app, install "JDK" v17.
What Version of JDK do I need?
Since the Release of farmerswife v6.8 you need to run at least OpenJDK v11 on the fw Server app's host machine if hosted on macOS and on Windows; and Linux you need to run v11 since v7.0, in order for the Web Client and Mobile Web Client (and fwplay if licensed) to work.
Any 7.1 Beta installer since 701_B05_NightlyBuild_2024-05-07T08-31Z requires Java / OpenJDK v17 to be installed!
The v7.0 SP4 fw Server apps on macOS, Windows and Linux will also work with Java 17!
IMPORTANT NOTES
- There are multiple different versions of Java available!
- Only use the "Hotspot" version as per the below info.
- Do not use higher Java versions than 17 LTS; since by design they have proven to cause the the web server from launching.
We recommend to manually keep OpenJDK up to date. If it is allowed to auto-update while the fw Server app is running, then the Web Client and Mobile Web Client can't be used until the fw Server app is restarted. You should first Quit the running fw Server app, then update OpenJDK and then launch the fw Server app again.
Instructions
While doing the below actions, ensure the fw Server app is not running, and also check in Activity Monitor on Mac or Windows Task Manager that no "Java" process is running!
1. First UNINSTALL ALL previous Java versions - especially the old deprecated v1.6, v1.7, v1.8, etc.- on the fw Server host machine; you might need to search for uninstall instructions.
It can help to use the Windows Task Manager or Activity Monitor on Mac to ensure that no "Java" process is still running.
Only then Install OpenJDK.
2. Download OpenJDK e.g. here for
https://adoptium.net/temurin/releases/?version=17&arch=any
Use the Version: "17- LTS" (17.0.10 or later) (If you are on a version previous to 7.1, please read about what version you should use above)
The installers are called for example:
For Windows: OpenJDK17U-jdk_x64_windows_hotspot_17.0.11_9.msi
For Mac: OpenJDK17U-jdk_x64_mac_hotspot_17.0.11_9.pkg
For Linux: OpenJDK17U-jdk_x64_linux_hotspot_17.0.11_9.tar.gz
⚠️ This is IMPORTANT in relation to the "log4j" exploit (December 2021)!
Ensure you have at least "LTS" Hotspot version 11.0.1 installed, even better follow the above info.
See more info on the "log4j" issue here: "log4j" exploit and farmerswife
We are using this on our side, and we recommend you do the same on yours.
3. After launching the fw Server application again, check e.g. that the Web Client is properly running.
Using the Windows Task Manager or Activity Monitor on Mac can help to ensure that now the "Java" process is running.
Known Errors and how to solve them:
"Error 500" - issues:
You are running a Java version higher than v11. Remove all Java versions on the host machine and follow the above instructions.
"Warning: The farmerswife New Web Server Is Not Starting"
You could still have old Java processes running. Check in Activity Monitor on Mac or Windows Task Manager that no "Java" process is running, and if so kill the process. Then restart your farmerswife server.
If you still have issues, please send an email with the steps you've taken, and either a screenshot of your server's log or the log.txt to [email protected]
Abbreviations:
fw - farmerswife
JRE - Java Runtime Environment
JDK - Java Development Kit
LTS - Long Term Support
v - version