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

Debian 12 - OpenJDK 17 (default VM) missing Nashorn #1793

Open
supremecmdr opened this issue Sep 25, 2023 · 5 comments
Open

Debian 12 - OpenJDK 17 (default VM) missing Nashorn #1793

supremecmdr opened this issue Sep 25, 2023 · 5 comments

Comments

@supremecmdr
Copy link

Describe the bug
I recently upgraded from Linux Debian 11 to Debian 12 and so did the Java VM, now the game fails to run completely with error.log mentioning "Caused by: java.lang.NoClassDefFoundError: jdk/nashorn/api/scripting/NashornScriptEngineFactory"

Expected behavior
Game should been starting up at the least.

To Reproduce
Install the default VM on a Linux Debian 12
java --version
openjdk 17.0.8 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-1deb12u1, mixed mode, sharing)

Attach files
Please either attach a copy of your error.log (in the LilithsThrone/data directory), or copy & paste the contents to the end of this bug report.
If applicable, add screenshots to help explain your problem.

Additional information:

  • Game version [0.4.8.3]
  • OS: [Linux Debian 12]
  • Using .jar or .exe: [.jar]
  • If using .jar, and you are not including an error.log file/text, please include your java version: [e.g. 1.8.0_172]
    error.log

All sources on the intenet mention the Nashorn has been deprecated since Java version 11 and finally removed since Java version 15.

@CognitiveMist
Copy link
Contributor

This is known. To run the game, you will either need to use a version of Java which includes the required dependencies, or compile it yourself. There is a tutorial for compilation in the root of this repo, or you can join the discord for further help.

Technically, the only officially supported version is Java 1.8.0_172. Other versions do work, but are considered at-your-own-risk and may require additional effort.

@EndsM
Copy link

EndsM commented Oct 10, 2023

Not familiar with Java, but nashorn is a JavaScript engine embedded in Java in version 8, but was removed in version 11.
I searched through the codebase for nashorn keyword, but only see it in pom.xml which indicate the dependencies of this project.
So I searched through the project, and find it using SVGO, which is a svg optimization tool that based on Node.js, so it does need a JavaScript Engine. Thus is unlikely you can just remove the nashorn dependency to make it upward compatible at this point, unless author have plan to port it to newer version of the Java, or change the svg optimization method, both of the solution would be quite time consuming.
So it is best to just get a JRE 8 to run the game.
TLDR: Download a Java 8 running environment

@ElAcechador
Copy link

Nashorn should be included in the release JARs since #1684, but it looks like the JARs Inno uploads to Google Drive and MEGA aren't built through the release pipeline or through Maven, so they're missing both Nashorn and JFX.

@Maxis010
Copy link
Contributor

Maxis010 commented Oct 16, 2023

Inno doesn't use Github workflows or Maven, those were added by the community
She also doesn't use latest Java for those JARs, she uses 1.8.0_172 which is the officially supported version

@CognitiveMist
Copy link
Contributor

CognitiveMist commented Nov 8, 2023

I searched through the codebase for nashorn keyword, but only see it in pom.xml which indicate the dependencies of this project. So I searched through the project, and find it using SVGO, which is a svg optimization tool that based on Node.js, so it does need a JavaScript Engine.

I don't know the purpose of the SVGO link in the pom.xml, but SVGO and Node.js are not actually used by the game at all; it's an entirely manual process. The svgo configuration in the repo root is simply provided as the standard optimization settings for using SVGO on any svg images.

The Nashorn engine is used in UtilText.java, where you can find the imports:

import jdk.nashorn.api.scripting.NashornScriptEngine;
import jdk.nashorn.api.scripting.NashornScriptEngineFactory;
// Use the following imports when using the org.openjdk.nashorn dependency:
//import org.openjdk.nashorn.api.scripting.NashornScriptEngine;
//import org.openjdk.nashorn.api.scripting.NashornScriptEngineFactory;

And this is used to perform dialog parsing. There has been some investigation into upgrading to the Graal engine, the new native javascript engine, but as I understand it, there are several significant differences that would need to be overcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants