SkyFactory 4 Java Version: Why It Needs Java 8 and How to Set It
SkyFactory 4 is one of the most played skyblock packs ever, but it's also old. It was built for Minecraft 1.12.2, and that version of Forge only works with one Java version. If your game or server crashes before it even reaches the menu, the wrong Java is almost always why.
1.8.0_xxx). The latest version, SkyFactory 4 4.2.4, runs on Minecraft 1.12.2 with Forge, and 1.12.2 Forge crashes on Java 9 and newer, including Java 17 and 21. On your PC, let the launcher use its bundled Java 8 or point the pack at a Java 8 install. On a server, run java -version, install 64-bit Java 8 if it says anything else, and start the server with that Java.What version is SkyFactory 4?
| Latest pack version | 4.2.4 (released December 2021) |
| Minecraft version | 1.12.2 |
| Mod loader | Forge (1.12.2 builds) |
| Java | Java 8, 64-bit |
SkyFactory 4 hasn't been updated since 4.2.4, so this won't change. Newer Minecraft versions don't affect it, and the newer SkyFactory 5 is a separate pack on a different Minecraft version and Java.
Why it won't run on Java 17 or 21
Forge for 1.12.2 starts the game through an old loader called LaunchWrapper. LaunchWrapper was written for Java 8 and expects a part of Java that was changed in Java 9. On any newer Java, it fails right away, before a single mod loads.
That means "newer is better" doesn't apply here. Java 17, 21 or 25 won't run SkyFactory 4 any faster. It won't run it at all.
The error you'll see
The most common crash on Java 9 and newer looks like this:
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader
cannot be cast to class java.net.URLClassLoader
at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
If you see AppClassLoader cannot be cast to class java.net.URLClassLoader and launchwrapper in the same log, your Java is too new. In the launcher this often shows up as just "exit code 1" or a crash a few seconds after you press Play, so open the log to check.
You may also see these, which mean the same thing:
Unrecognized option: --add-opensorError: Could not create the Java Virtual Machine. This happens the other way around: you're on Java 8 now, but you still have Java 17+ flags in your JVM arguments. Remove them.Unsupported class file major version. Our guide on the unsupported class file major version error explains how to read the number.
Check which Java you have
On a PC or server, open a terminal (Command Prompt on Windows) and run:
java -version
Java 8 prints a version that starts with 1.8.0:
openjdk version "1.8.0_472"
Anything that says 17, 21 or 25 is too new for SkyFactory 4. Note that this only shows the Java on your system path. Launchers usually use their own Java, so check the launcher settings below too.
How to set Java 8 in the CurseForge app
The CurseForge app normally uses the Java that Mojang provides for each Minecraft version, which is Java 8 for 1.12.2. Problems start when a custom Java path was set.
- Click the cog (Settings) in the bottom left.
- Open the Minecraft section and scroll to the Java settings.
- Check the entry for Java 8. If it points to a Java 17 or 21 folder, change it to a real Java 8 install, or clear it so the app uses its own.
- Open the SkyFactory 4 profile, click the three dots, open Profile Options, and remove any custom JVM arguments that came from a newer pack (for example
--add-openslines or ZGC flags). - Launch again.
While you're in Profile Options, check the memory too. SkyFactory 4 wants about 6GB on your PC. Our guide on giving Minecraft more RAM shows where to set it.
How to set Java 8 in Prism Launcher
- Select the SkyFactory 4 instance and click Edit.
- Open Settings, then the Java tab.
- Tick Java installation so the instance uses its own Java.
- Click Auto-detect and pick an entry that starts with
1.8.0. If none shows up, install Java 8 first (Eclipse Temurin 8 from adoptium.net is free), then auto-detect again. Recent Prism versions can also download a Java version for you from this screen. - Make sure the JVM arguments box doesn't contain flags for newer Java.
- Click Close and launch.
Prism also checks whether the chosen Java fits the Minecraft version. If it warns you about Java on a 1.12.2 instance, believe it and switch to Java 8.
Fixing it on a SkyFactory 4 server
The server needs Java 8 just like the client. The server files for 4.2.4 come with start scripts that run whatever java is on the system path, so if the machine has Java 21 installed by default, the server crashes with the error above.
1. Check the Java version
java -version
If it isn't 1.8.0_something, install 64-bit Java 8.
2. Install Java 8
On Ubuntu:
sudo apt update
sudo apt install openjdk-8-jre-headless
On Windows or other Linux systems, download the Java 8 JRE or JDK from Eclipse Temurin (adoptium.net).
Installing Java 8 doesn't remove your newer Java, so the plain java command may still point to Java 21. You fix that in the next step.
3. Start the server with Java 8
Edit the start script so it uses the full path to Java 8 instead of plain java. On Ubuntu it usually looks like:
/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Xms4G -Xmx6G -jar forge-server.jar nogui
Replace forge-server.jar with the actual Forge jar name in your server folder, and keep any arguments the original script already had. On Windows, the path is something like "C:\Program Files\Eclipse Adoptium\jdk-8...\bin\java.exe", in quotes because of the space.
4. Remove flags Java 8 doesn't understand
If you copied startup flags from a newer server, Java 8 will refuse to start. Remove anything like --add-opens, -XX:+UseZGC or -XX:+UseShenandoahGC. The usual G1 flags (such as -XX:+UseG1GC) are fine on Java 8.
5. Start it and read the log
A good start reaches a line like Done (xx.xs)! For help, type "help". SkyFactory 4 can take a few minutes to get there, which is normal.
For RAM, setup and world type tips, see our full SkyFactory server guide. For a chart of which Java every Minecraft version needs, see which Java version your server needs.
Quick fix checklist
| Symptom | Fix |
|---|---|
AppClassLoader cannot be cast to class java.net.URLClassLoader |
Java is too new, switch to Java 8 |
Unrecognized option: --add-opens |
Remove newer Java flags from JVM arguments |
| Launcher says Java 8 is missing | Install 64-bit Java 8 and select it, or let the launcher use its own |
| Can't set more than about 1.5GB of RAM | You're on 32-bit Java 8, install the 64-bit one |
| Server still crashes after installing Java 8 | The start script still calls plain java, use the full Java 8 path |
On FreaksMC, servers on Minecraft 1.12.2 are started with Java 8 automatically, so SkyFactory 4 boots without changing any startup settings.
Want a server that just runs fast?
FreaksMC servers run on AMD Ryzen 9 7950X3D processors with fast NVMe storage. Pick vanilla, Paper or a modpack and your server is ready in minutes.
See plans from $4/mo