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

Exception in thread "main" java.lang.Exception: Failed to find main class " -Xmx16G" #3232

Open
TrueOsiris opened this issue Jan 4, 2025 · 1 comment

Comments

@TrueOsiris
Copy link

Describe the problem

This Exception occured when running the latest Better Minecraft (v36)
Exception in thread "main" java.lang.Exception: Failed to find main class " -Xmx16G"

it might be related to this issue: https://stackoverflow.com/questions/45490492/error-could-not-find-or-load-main-class-xmx1g

Container definition

services:
  minecraft_bettermc:
    image: itzg/minecraft-server
    labels:
      net.unraid.docker.icon: "https://timmer.ninja/images/ico/better_minecraft.ico"   
    tty: true
    stdin_open: true
    ports:
      - "25567:25567"
    environment:
      VERSION: 1.20.1
      EULA: true
      UID: 1000
      GID: 100 
      INIT_MEMORY: 4G
      MAX_MEMORY: 16G
      TZ: Europe/Brussels
      ICON: "https://timmer.ninja/images/ico/better_minecraft.ico"
      MAX_PLAYERS: 16
      VIEW_DISTANCE: 16
      MODE: survival # creative survival adventure spectator
      SERVER_NAME: "Better Minecraft Timmer.Ninja"
      SERVER_PORT: 25567
      STOP_SERVER_ANNOUNCE_DELAY: 300
      MOD_PLATFORM: CURSEFORGE #AUTO_CURSEFORGE
      CF_SERVER_MOD: "modpacks/BMC4_Server_Pack_v36.zip"
      #FTB_LEGACYJAVAFIXER: true
    volumes:
      - /mnt/user/docker_volumes/games/minecraft_bettermc:/data
    network_mode: bridge

Container logs

...
minecraft_bettermc-minecraft_bettermc-1  | Starting server...
minecraft_bettermc-minecraft_bettermc-1  | Minecraft version:              1.20.1
minecraft_bettermc-minecraft_bettermc-1  | Modloader:                      Forge
minecraft_bettermc-minecraft_bettermc-1  | Modloader version:              47.3.12
minecraft_bettermc-minecraft_bettermc-1  | LegacyFabric Installer Version: 1.0.0
minecraft_bettermc-minecraft_bettermc-1  | Fabric Installer Version:       1.0.1
minecraft_bettermc-minecraft_bettermc-1  | Quilt Installer Version:        0.9.2
minecraft_bettermc-minecraft_bettermc-1  | Java Args:                       -Xmx16G -Xms4G
minecraft_bettermc-minecraft_bettermc-1  | Additional Args:                -Dlog4j2.formatMsgNoLookups=true
minecraft_bettermc-minecraft_bettermc-1  | Java Path:                      java
minecraft_bettermc-minecraft_bettermc-1  | Wait For User Input:            false
minecraft_bettermc-minecraft_bettermc-1  | Run Command:       java -Dlog4j2.formatMsgNoLookups=true @user_jvm_args.txt -Djava.security.manager=allow -Dfml.queryResult=confirm -jar server.jar --installer-force --installer https://files.minecraftforge.net/maven/net/minecraftforge/forge/1.20.1-47.3.12/forge-1.20.1-47.3.12-installer.jar nogui
minecraft_bettermc-minecraft_bettermc-1  | Java version:
minecraft_bettermc-minecraft_bettermc-1  | java version "21.0.4" 2024-07-16 LTS
minecraft_bettermc-minecraft_bettermc-1  | Java(TM) SE Runtime Environment Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41)
minecraft_bettermc-minecraft_bettermc-1  | Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41, mixed mode, sharing)
minecraft_bettermc-minecraft_bettermc-1  |
minecraft_bettermc-minecraft_bettermc-1  | Exception in thread "main" java.lang.Exception: Failed to find main class " -Xmx16G"
minecraft_bettermc-minecraft_bettermc-1  |      at net.neoforged.serverstarterjar.Main.mainLaunch(Main.java:288)
minecraft_bettermc-minecraft_bettermc-1  |      at net.neoforged.serverstarterjar.Main.main(Main.java:79)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/java.lang.reflect.Method.invoke(Method.java:580)
minecraft_bettermc-minecraft_bettermc-1  |      at net.neoforged.serverstarterjar.Main8.main(Main8.java:19)
minecraft_bettermc-minecraft_bettermc-1  | Caused by: java.lang.ClassNotFoundException:  -Xmx16G
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/java.lang.Class.forName0(Native Method)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/java.lang.Class.forName(Class.java:421)
minecraft_bettermc-minecraft_bettermc-1  |      at java.base/java.lang.Class.forName(Class.java:412)
minecraft_bettermc-minecraft_bettermc-1  |      at net.neoforged.serverstarterjar.Main.mainLaunch(Main.java:286)
minecraft_bettermc-minecraft_bettermc-1  |      ... 4 more
minecraft_bettermc-minecraft_bettermc-1  | Exiting...
minecraft_bettermc-minecraft_bettermc-1  | 2025-01-04T22:49:07.185+0100 INFO    mc-server-runner        Done

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

No branches or pull requests

2 participants