6

I am using Ubuntu Server to host multiple Minecraft servers. For the latest versions of Minecraft, I need the latest version of Java; however, I would like to run a modded server as well and some of the mods are incompatible with the newest version of Java. How can I run the modded server using Java version 15 while running the other servers using the newest version? I am fairly new to Ubuntu Server so any help would be much appreciated.

3
  • Why not just have multiple versions of Java installed? If you need something complex, you could also use Docker if you wanted a more complex setup.
    – cocomac
    Jan 2, 2022 at 0:20
  • @cocomac I have multiple versions of Java installed; however, when you use the javacommand it defaults to the system default jdk does it not? I'm new to this so maybe I'm wrong. Jan 2, 2022 at 0:23
  • Manually, you could use portable javas, such as zulu, temurin, liberica...etc, then have a folder that contains any version javas you need. Or using java version manager to mange javas, or using server management tool to add/specify java per server.
    – Tokenyet
    Apr 17, 2022 at 13:30

1 Answer 1

6

I believe you could run the java executable located in (I think) /usr/lib/jvm/java-(version)-(vendor)/bin/java the same way you'd just use the java link.

You'd still need to install the correct jvm version.

3
  • How would I do that? Sorry if this is a stupid question. Can I run multiple versions by adding something to the command to start the server? Almost like adding a command-line argument? I'm sorry, I don't follow. Jan 2, 2022 at 0:22
  • 1
    Instead of doing java -jar minecraft.jar, you'd just replace the java with the path of the java 8 executable, for example with OpenJDK 8, /usr/lib/jvm/java-8-openjdk/bin/java -jar minecraft.jar Jan 2, 2022 at 0:24
  • 1
    You could java anywhere you have downloaded it, not just /us/lib/jvm. Just run /anywhere/bin/java -jar minecraft.jar
    – Redbob
    Jan 4, 2022 at 18:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .