Oracle JRE pkg on silicon Mac return "OS error code 1". Solution
This post really helped me solve this problem: https://www.codejam.info/2022/04/repackage-macos-app-m1-support-without-rosetta.html
There is no need to go too deep into this post, that's all you need to do:
- Mount dmg from ARM64 version of the JRE (but don't install pkg!)
- Copy cp -r /Volumes/Java\ 8\ Update\ 431/Java\ 8\ Update\ 431.app/Contents/Resources/JavaAppletPlugin.pkg to some place.
- In this place, create some directory of your own, for example PluginDir
- cd PluginDir; xar -xf ../JavaAppletPlugin.pkg
- vim Distribution
- Insert "<options hostArchitectures="arm64,x86_64" />" in anywhere inside the installer-gui-script node.
- Create new package: xar --compression none -cf ../JavaAppletPlugin-new.pkg .
- sudo /usr/sbin/installer -verbose -pkg "/Path/to/JavaAppletPlugin-new.pkg" -target /