Fix Fisk and Nashorn

Runs Fisk's Superheroes on Java 17+ (lwjgl3ify) by redirecting it to standalone Nashorn, without modifying Fisk's jar.

FiskNashornFix

Run Fisk's Superheroes on modern Java (17 to 25) with lwjgl3ify, on Minecraft 1.7.10.

The problem

Fisk's Superheroes runs its hero packs with Nashorn, the JavaScript engine that shipped with Java 8. Nashorn was removed from Java in version 15. When a 1.7.10 pack runs on modern Java through lwjgl3ify, Fisk's Superheroes crashes during mod loading:

Caused by: java.lang.IllegalStateException: Nashorn JavaScript engine == null
Caused by: java.lang.ClassNotFoundException: Class bytes are null for jdk.nashorn.api.scripting.NashornScriptEngineFactory

lwjgl3ify can redirect Nashorn class references, but Fisk loads Nashorn by name (as plain text), which that redirect does not cover.

What this mod does

FiskNashornFix is a tiny coremod (under 10 KB, no dependencies of its own):

  1. Redirects Fisk to standalone Nashorn at load time. When Fisk's classes load, the names jdk.nashorn.* are rewritten to org.openjdk.nashorn.* (the standalone OpenJDK Nashorn). Fisk's jar file is never modified.
  2. Downloads standalone Nashorn automatically. On the first launch, before lwjgl3ify restarts the game on modern Java, it downloads Nashorn 15.7 and ASM 9.11 from Maven Central into the lwjgl3ify-nashorn folder of your instance. Every file is checked against a pinned SHA-1 hash; any file that does not match is rejected.
  3. Keeps older coremods working. It copies five legacy ASM classes (Remapping*Adapter) from your installed lwjgl3ify jar into lwjgl3ify-nashorn-patch, so mods that still use them (for example Entity Culling Unofficial) keep working once ASM is loaded as a Java module.

On Java 8 it does nothing: Fisk keeps using the Nashorn built into Java 8, so it is safe to leave installed.

Requirements

  • Minecraft 1.7.10 with Forge 10.13.4.1614
  • Fisk's Superheroes 2.4.0
  • lwjgl3ify (relauncher mode) and UniMixins
  • Java 17 or newer (other mods in your pack may require a newer version)
  • An internet connection on the first launch

Setup

Add these options to the lwjgl3ify relauncher.

From the "Lwjgl3ify settings" window (shown when the game starts): paste them into Custom options, one per line:

--module-path
lwjgl3ify-nashorn
--add-modules
org.openjdk.nashorn
--patch-module
org.objectweb.asm.commons=lwjgl3ify-nashorn-patch/asm-commons-legacy.jar

Or in config/lwjgl3ify-relauncher.json:

"customOptions": [
  "--module-path", "lwjgl3ify-nashorn",
  "--add-modules", "org.openjdk.nashorn",
  "--patch-module", "org.objectweb.asm.commons=lwjgl3ify-nashorn-patch/asm-commons-legacy.jar"
]

The paths are relative to the instance folder, so they work on any computer.

Modpack authors: ship this config file with your pack (without your personal javaInstallationsCache entry). Your players then only have to pick their Java version in the lwjgl3ify window.

Tested with

  • Minecraft 1.7.10, Forge 10.13.4.1614
  • Fisk's Superheroes 2.4.0
  • lwjgl3ify 3.0.38, UniMixins 0.3.1
  • Java 25.0.4 (Eclipse Temurin) on Windows 11
  • A 139-mod pack including Beddium, FalseTweaks, Hodgepodge, ArchaicFix, Lumi and SwanSong

Troubleshooting

  • "Nashorn JavaScript engine == null": the custom options above are missing, or the game was not relaunched through lwjgl3ify.
  • "Module org.openjdk.nashorn not found", or the game does not start after choosing Java: the download failed (no internet on the first launch). Look for [FiskNashornFix] lines in the log, then restart with an internet connection.
  • Corrupted files: delete the lwjgl3ify-nashorn and lwjgl3ify-nashorn-patch folders; they are downloaded or recreated on the next launch.
  • Dedicated servers: not tested. The lwjgl3ify relauncher is client-only; on a server you would have to provide Nashorn through your own JVM arguments.

Uninstall

Remove the jar, the three custom options, and the lwjgl3ify-nashorn and lwjgl3ify-nashorn-patch folders.

Credits and license

  • Fisk's Superheroes by FiskFille. This project is not affiliated with Fisk's Superheroes and does not include or redistribute any of its files.
  • lwjgl3ify by GTNewHorizons.
  • Standalone Nashorn by OpenJDK (GPL v2 with Classpath Exception) and ASM by OW2 (BSD): downloaded from Maven Central on your computer, not bundled in this mod.
  • FiskNashornFix is released under the MIT license.

Fix Fisk and Nashorn Team

profile avatar
  • 5
    Projects
  • 1.3K
    Downloads

More from Protoype_XkView all