[Improvement]: Recommend/Warn Java 8 for older Minecraft versions in script #526

Closed
opened 2026-06-26 21:12:36 +02:00 by Griefed · 10 comments
Owner

@kreezxil on GitHub · https://github.com/Griefed/ServerPackCreator/issues/479

What happened?

Now that Minecraft and server pack creator are well beyond the Java 8 packs, especially 1.12.2, we have an interesting issue happening.

Most users have a newer than java 8 install on their systems. If they try run install.sh or .ps1 using the not java 8 java the libaries folder will fail to extract.

This was pointed out to me with my https://www.curseforge.com/minecraft/modpacks/world-of-dragons
server pack. Took a fair bit to understand what was happening.

Since I"m pack and on again off again mod dev, i naturally have a lot of javas on hand so, once I told variables text to use java8 (that's what i called my java 8 binary), the library extracted.

What did you expect to happen?

Through no fault of SPC, I did kind of expect the installer script to actually extract libraries folder, but thinking about it ... I think I'd want it to tell the user that it expects a different version of java to do its thing. this may be too much to ask for and yes I know as each day marches on, less and less do we see java 8 servers running.

Version

4.3.2 and 5.0.0-beta.10

Relevant log output

log captured from the console, there is some kind of socket except when using java 17 and the libraries refuse to extract from the java 8 compiled jar.

https://paste.centos.org/view/6b1f66a1

variables.txt: https://paste.centos.org/view/412df769

variables.txt (**but now it points to my java 8 binary**): https://paste.centos.org/view/2bbf5aea

The now functioning log: https://paste.centos.org/view/fd5798ad

Anything else you would like to add?

Keep up the good work, and I'm not holing my breath as stated above.

If you are using the webservice, in which browers did you encounter this bug?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
<!-- repoman:origin --> > **@kreezxil** on **GitHub** · https://github.com/Griefed/ServerPackCreator/issues/479 ### What happened? Now that Minecraft and server pack creator are well beyond the Java 8 packs, especially 1.12.2, we have an interesting issue happening. Most users have a newer than java 8 install on their systems. If they try run install.sh or .ps1 using the **not java 8** java the libaries folder will fail to extract. This was pointed out to me with my https://www.curseforge.com/minecraft/modpacks/world-of-dragons server pack. Took a fair bit to understand what was happening. Since I"m pack and on again off again mod dev, i naturally have a lot of javas on hand so, once I told variables text to use java8 (that's what i called my java 8 binary), the library extracted. ### What did you expect to happen? Through no fault of SPC, I did kind of expect the installer script to actually extract libraries folder, but thinking about it ... I think I'd want it to tell the user that it expects a different version of java to do its thing. **this may be** too much to ask for and yes I know as each day marches on, less and less do we see java 8 servers running. ### Version 4.3.2 and 5.0.0-beta.10 ### Relevant log output ```shell log captured from the console, there is some kind of socket except when using java 17 and the libraries refuse to extract from the java 8 compiled jar. https://paste.centos.org/view/6b1f66a1 variables.txt: https://paste.centos.org/view/412df769 variables.txt (**but now it points to my java 8 binary**): https://paste.centos.org/view/2bbf5aea The now functioning log: https://paste.centos.org/view/fd5798ad ``` ### Anything else you would like to add? Keep up the good work, and I'm not holing my breath as stated above. ### If you are using the webservice, in which browers did you encounter this bug? _No response_ ### Code of Conduct - [X] I agree to follow this project's Code of Conduct
Author
Owner

@Griefed on GitHub

Heya Kreezxil,

ohhhh so now we have the reverse situation at hand, did I understand that correctly?
Whereas before we have people trying to run newer packs with older Java versions, people are now trying to run older packs with newer Java versions?

<!-- repoman:origin --> > **@Griefed** on **GitHub** Heya Kreezxil, ohhhh so now we have the reverse situation at hand, did I understand that correctly? Whereas before we have people trying to run newer packs with older Java versions, people are now trying to run older packs with newer Java versions?
Author
Owner

@Griefed on GitHub

Related to this: https://github.com/Griefed/ServerPackCreator/issues/445
The aforementioned issue talks about people running server packs with older Java versions and whether we have a way to capture / check / prevent and maybe inform the user in an easy-to-understand way.

<!-- repoman:origin --> > **@Griefed** on **GitHub** Related to this: https://github.com/Griefed/ServerPackCreator/issues/445 The aforementioned issue talks about people running server packs with older Java versions and whether we have a way to capture / check / prevent and maybe inform the user in an easy-to-understand way.
Author
Owner

@kreezxil on GitHub

Yes, apparently this is the UNO reverse card.

<!-- repoman:origin --> > **@kreezxil** on **GitHub** Yes, apparently this is the UNO reverse card.
Author
Owner

@Griefed on GitHub

Heya Kreezxil,

if I remember correctly, you usually have multiple Java installations available on your machine. I'd like some feedback from people's environments other than my own (sanity check). Could you run the following command and post the return from it here?

which -a java | xargs -I{} echo "echo {};{} -version;echo" | sh

It should list all Java installations available in the system path and print their versions. Trying to determine whether that would be a viable way to discover available Java installations in a bash-script.

Cheers

<!-- repoman:origin --> > **@Griefed** on **GitHub** Heya Kreezxil, if I remember correctly, you usually have multiple Java installations available on your machine. I'd like some feedback from people's environments other than my own (sanity check). Could you run the following command and post the return from it here? `which -a java | xargs -I{} echo "echo {};{} -version;echo" | sh` It should list all Java installations available in the system path and print their versions. Trying to determine whether that would be a viable way to discover available Java installations in a bash-script. Cheers
Author
Owner

@kreezxil on GitHub

I've actually done a Linux reset since talking about that, because I experimented way too much, however, I have java in two locations and your command produced the following output.

/usr/bin/java
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7)
OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode)

/usr/lib/jvm/default/bin/java
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7)
OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode)

<!-- repoman:origin --> > **@kreezxil** on **GitHub** I've actually done a Linux reset since talking about that, because I experimented way too much, however, I have java in two locations and your command produced the following output. ``` /usr/bin/java openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7) OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode) /usr/lib/jvm/default/bin/java openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment (build 17.0.10+7) OpenJDK 64-Bit Server VM (build 17.0.10+7, mixed mode) ```
Author
Owner

@Griefed on GitHub

Thanks for the feedback.
That looks like the command found the symlink (1st one) as well as the actual installation (2nd one).

I'll run some more tests on my end soonish.

<!-- repoman:origin --> > **@Griefed** on **GitHub** Thanks for the feedback. That looks like the command found the symlink (1st one) as well as the actual installation (2nd one). I'll run some more tests on my end soonish.
Author
Owner

@kreezxil on GitHub

I responded too quick, I check my /usr/lib/jvm and it did not detect my other installations of Java 8 and Java 22.

<!-- repoman:origin --> > **@kreezxil** on **GitHub** I responded too quick, I check my /usr/lib/jvm and it did not detect my other installations of Java 8 and Java 22.
Author
Owner

@Griefed on GitHub

Java checks are available as of https://github.com/Griefed/ServerPackCreator/releases/tag/6.0.0-alpha.3

Checks are based on the info from MultiMC and the info Chorb posted somewhere, as in MC 1.16 and older can use Java 8 and 11, everything else has a "minimum required" check.

This should aleviate at least a portion of problems on the users side for their Java version.

<!-- repoman:origin --> > **@Griefed** on **GitHub** Java checks are available as of https://github.com/Griefed/ServerPackCreator/releases/tag/6.0.0-alpha.3 Checks are based on the info from [MultiMC](https://github.com/MultiMC/Launcher/wiki/Using-the-right-Java) and the info Chorb posted somewhere, as in MC 1.16 and older can use Java 8 and 11, everything else has a "minimum required" check. This should aleviate at least a portion of problems on the users side for their Java version.
Author
Owner

@Griefed on GitHub

Check out the latest alpha build: https://github.com/Griefed/ServerPackCreator/releases/tag/6.0.0-alpha.11

It not only has Java compatibility checks, which were added in alpha 3, but also automated Java installation based on the Java version recommended by Mojang themselves.

I'd appreciate some tests on this. :)

<!-- repoman:origin --> > **@Griefed** on **GitHub** Check out the latest alpha build: https://github.com/Griefed/ServerPackCreator/releases/tag/6.0.0-alpha.11 It not only has Java compatibility checks, which were added in alpha 3, but also automated Java installation based on the Java version recommended by Mojang themselves. I'd appreciate some tests on this. :)
Author
Owner

@Griefed on GitHub

Available as of 6.0.0

<!-- repoman:origin --> > **@Griefed** on **GitHub** Available as of [6.0.0](https://github.com/Griefed/ServerPackCreator/releases/tag/6.0.0)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Griefed/ServerPackCreator#526
No description provided.