Installed neoforge server doesn't check for java version
run.sh and run.bat both do not check for the version of the java binary that they will invoke. At least on Linux, this means that using Java 8 instead of 21 will cause the script to not fully execute (literally fails trying to use the user_jvm_args.txt).
Steps to reproduce:
set default java binary to the wrong version (eg. archlinux-java set openjdk-8)
install neoforge server (eg. the latest 1.21.4 beta)
./run.sh or ./run.bat
script errors; no server files generated
Possible fixes: -Include java in server files (download while generating run.sh or include it in the jar) -Have run.sh check for available java binaries -Have run.sh download an appropriate java binary on first use, and use it each time -Spit out an error if java version is inappropriate
(run.sh or run.bat) (first fix is stupid but works anyway)
If more information is needed feel free to reply
Because of the issue listed above, my minecraft server wont start due to some sort reading issue. I personaly am NOT a developer and have no idea how to actually "fix" the issue. If possible could you give me some pointers on how i can make it check the java version?
Start scripts by default invoke java, which uses the Java version present in your path and JAVA_HOME environment variable. If you would like to change what Java version is used you can either change it for the whole system/user, or you can change the path to it in the run script. Upon further thought, while having a check inside the run script would indeed be nice, it would be a fair amount of work just for a better error message. Of note however is that the ServerStarterJar already has a check to ensure you're running the correct Java version for the version you're trying to launch with a more descriptive error message.
While this is a nice future goal, I'm closing this issue for now as it's far from an immediate or prioritized one.