portablemc icon indicating copy to clipboard operation
portablemc copied to clipboard

Starting Minecraft older than 1.19 crashes on Apple Silicon

Open JXSnack opened this issue 1 year ago • 21 comments

My code

from portablemc.standard import Version
Version("1.12.2").install().run()

Crashes with

Traceback (most recent call last):
  File "/Users/joram/PycharmProjects/EastShoreLauncher/portablemc/standard.py", line 851, in _resolve_jvm
    with jvm_manifest_file.open("rt") as jvm_manifest_fp:
  File "/opt/homebrew/Cellar/[email protected]/3.10.12_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/Users/joram/Library/Application Support/minecraft/jvm/jre-legacy.json'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/joram/PycharmProjects/EastShoreLauncher/portablemc/standard.py", line 930, in _resolve_builtin_jvm
    version_start = stdout.index(f"1.{major_version}" if major_version <= 8 else str(major_version))
ValueError: substring not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/joram/PycharmProjects/EastShoreLauncher/main.py", line 2, in <module>
    Version("1.12.2").install().run()
  File "/Users/joram/PycharmProjects/EastShoreLauncher/portablemc/standard.py", line 316, in install
    self._resolve_jvm(watcher)  # JVM added here on purpose to ease implementation of ForgeVersion
  File "/Users/joram/PycharmProjects/EastShoreLauncher/portablemc/standard.py", line 865, in _resolve_jvm
    return self._resolve_builtin_jvm(watcher, JvmNotFoundError.UNSUPPORTED_VERSION, jvm_major_version)
  File "/Users/joram/PycharmProjects/EastShoreLauncher/portablemc/standard.py", line 943, in _resolve_builtin_jvm
    raise JvmNotFoundError(JvmNotFoundError.BUILTIN_INVALID_VERSION)
portablemc.standard.JvmNotFoundError: 'builtin_invalid_version'

If I understand this correctly, it can't find the correct JVM. I tried using Zulu-8, so I tried this

portablemc start 1.12.2 --jvm /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java

but it crashed with

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/client/main/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:757)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:621)

JXSnack avatar Aug 20 '23 11:08 JXSnack