Open erwynne opened 10 months ago
I was able to fix by downloading JavaFX on my computer and then pointing it to module path of JavaFX and then to the Jars in a bat file I have to use whenever I want to use the jars. But all people using newer Java will have this problem. Still, when I run the Server version, it asks me what I want to sync,in 4.3.0... how do I use the Server version as it is intended - to allow my Client version to sync to Server? Both server and client simply say "Failed to connect to server".
https://github.com/superzanti/ServerSync/wiki/Server-setup
By default if I recall the generated server config will sync a folder called mods in the same location as the serversync jar/exe file.
JafaFX is a hard requirement, its probably possible to include it in the uber jar though it would rather significantly increase the size of the app.
Failing to connect to the server would imply:
There is an experimental version of a modular app that packages JFX + JRE here https://github.com/rheimus/ServerSync/releases but I have not worked on it in a long time and it was never really up to the workflow that I wanted.
Thanks for the write up! I appreciate it. I was able to fix it just adding -s, it was my own fault of it. But I did have to install the JFX separately. That worked. So if I give it to another person, should I assume they are going to be running a version of Java which does not have JFX and thusly, I should include it in the modpack in a folder with the bat file which will automatically use the JFX location in the modpack? I thought of that as an idea. I am giving it to people who (while myself not a power user) are not power users, and do not really know how to do things like "now download JFX and make the bat module path point to it" so trying to find a way to conveniently drop it in via the Import feature of Curseforge (which allows you to package entire folders with whatever you want in them even if those folders are not originally offered by Curseforge).
As of writing this you have three options I can think of off the top of my head:
--progress
or --silent
so no GUI is rendered, thus no JFX requirementCLI reference is here https://github.com/superzanti/ServerSync/wiki/Command-line-arguments or java -jar serverysnc.jar -h
I did it and it works! For other people, I will put it right here, so they can use it too...
This is how I was able to make a bat file, that will automatically get the location of the JavaFX, assuming it is in the folder that will be given to the user. And this is the file you will put and tell your friends to run when they want to update.
@echo off
setlocal
set JAVA_FX_PATH=%~dp0openjfx-21.0.2_windows-x64_bin-sdk\javafx-sdk-21.0.2\lib
java --module-path "%JAVA_FX_PATH%" --add-modules javafx.controls,javafx.fxml -jar ServerSyncClient.exe
endlocal
Best of luck to all and thank you Rheimus for your fabulous tool
Awesome, nice work finding a solution.
You might need to ship the linux & mac java fx distributions if you support users on those platforms though.
Serversync Version:
4.3.0 and 4.1.0 tried, neither works
Minecraft Version:
1.20.4
Issue:
Usually, it would silent crash after making a json, it would simply not appear. I ran it cd to my folder in Curseforge and I did java -jar and put it in. Got this error on Client.
C:\Users\Jenkins\curseforge\minecraft\Instances\serbr pack 2\mods>java -jar "C:\Users\Jenkins\curseforge\minecraft\Instances\serbr pack 2\mods\ServerSyncClient.exe" [Feb 08, 2024 12:58:47][ServerSync] INFO: Root dir: C:\Users\Jenkins\curseforge\minecraft\Instances\serbr pack 2\mods [Feb 08, 2024 12:58:47][ServerSync] INFO: Running version: v4.3.0 [Feb 08, 2024 12:58:47][ServerSync] INFO: Loading language file: en_US Exception in thread "Thread-0" java.lang.NoClassDefFoundError: javafx/application/Application at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at com.superzanti.serversync.GUIJavaFX.GUI_Launcher.run(GUI_Launcher.java:9) Caused by: java.lang.ClassNotFoundException: javafx.application.Application at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 10 more
When try to run server, it appears for 0.1 seconds then closes before it even loads all lines of the error. But have done again in CMD to show error.
C:\Users\Jenkins\Desktop\fabric 1.20\mods>java -jar "C:\Users\Jenkins\Desktop\fabric 1.20\mods\ServerSyncServer.exe" [Feb 08, 2024 1:01:17][ServerSync] INFO: Root dir: C:\Users\Jenkins\Desktop\fabric 1.20\mods [Feb 08, 2024 1:01:17][ServerSync] INFO: Running version: v4.3.0 [Feb 08, 2024 1:01:17][ServerSync] INFO: Loading language file: en_US Exception in thread "Thread-0" java.lang.NoClassDefFoundError: javafx/application/Application at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at com.superzanti.serversync.GUIJavaFX.GUI_Launcher.run(GUI_Launcher.java:9) Caused by: java.lang.ClassNotFoundException: javafx.application.Application at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 10 more
I am using this version of Java.
C:\Users\Jenkins\Desktop\fabric 1.20\mods>java -version java version "19" 2022-09-20 Java(TM) SE Runtime Environment (build 19+36-2238) Java HotSpot(TM) 64-Bit Server VM (build 19+36-2238, mixed mode, sharing)
Apparently this occurs when something wants to use JavaFX, but new versions of Java do not include JavaFX so the program itself needs to add its own JavaFX, maybe I am wrong? This is what it said online, but I don't know how to add it to your program, and I am not really sure what Maven or Gradle is. "If you're using a build tool like Maven or Gradle, you can easily add JavaFX as a dependency. This way, the required libraries will be automatically included in your project." I would appreciate any help. I have to use this version of Java to use my Minecraft server 1.20.4, older versions cause it to have errors.
Thank you!