- Java Downloads
- Cannot find JavaFX or No Class Def Found Error
- Double clicking ChunkyLauncher.jar doesn’t work on Windows?
- Batch script to launch (Windows)
As stated in Installation, Chunky requires Java 8 update 40 or later (with JavaFX) and it is recommended that you use the 64 bit Java version if you have a 64 bit OS.
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/stage/Stage at se.llbit.chunky.launcher.ChunkyLauncher.firstTimeSetup(ChunkyLauncher.java:274) at se.llbit.chunky.launcher.ChunkyLauncher.main(ChunkyLauncher.java:192) Caused by: java.lang.ClassNotFoundException: javafx.stage.Stage at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 2 more
JavaFX/OpenJFX are often the short straw and unfortunately Chunky needs them. Below are a few solutions depending on platform and Java version.
Below is a script you can run on Ubuntu to obtain and retain a working OpenJFX. credit - UNuX#1985 - 11/07/2019
#!/bin/bash su apt install openjdk-8-jre mkdir -p /tmp/chunky-deps-tmp cd /tmp/chunky-deps-tmp wget https://launchpadlibrarian.net/363521276/libopenjfx-jni_8u161-b12-1ubuntu2_amd64.deb wget https://launchpadlibrarian.net/363521272/libopenjfx-java_8u161-b12-1ubuntu2_all.deb wget https://launchpadlibrarian.net/363521275/openjfx_8u161-b12-1ubuntu2_amd64.deb dpkg -i *.deb apt-mark hold openjfx libopenjfx-java libopenjfx-jni
On Windows, OpenJDK does not come with OpenJFX and is does not, at the time of writing, have an official source. Instead you will need to find a pre-compiled build though I would not recommend this.
If you wish to run Chunky on Java 11+ you will need to ensure you have ChunkyLauncher v1.12.1, or later, in addtion to OpenJFX.
Install the OpenJDK of your choice.
Download the OpenJFX Windows SDK from gluonhq, extract to
C:\Program Files\openjfxwith the folder structure seen below.
Launch ChunkyLauncher.jar either by double clicking the .jar file or by using
java -jar "path\to\chunkylauncher\chunkylauncher.jar"
Inside ChunkyLauncher, under Advanced Settings, the
Java optionsfield should be auto-populated with
--add-moduleswhich point towards the openjfx install location.
--module-path "C:\Program Files\openjfx" --add-modules=javafx.controls,javafx.base,javafx.graphics,javafx.fxml
If you get the following error:
java.lang.LayerInstantiationException: Package jdk.internal.jimage in both module java.base and module jrt.fs, open
C:\Program Files\openjfx\lib and delete
jrt-fs.jar; However this issue typically occurs if you merge OpenJFX’s
lib folder into your OpenJDK
A common issue with Java on Windows is that jar files may not be correctly associated with Java.
This can be fixed by either uninstalling and reinstalling Java or through using an application like Jarfix or through launching via CMD, ie
java -jar "path\to\chunkylauncher\chunkylauncher.jar".
Don’t want to have to type out commands each time you want to launch Chunky? Well in comes Batch scripts!
.txt file and enter the following lines, adjusting them where necessary to match the commands you need, then save the file as a
.bat file in the same directory as ChunkyLauncher.jar.
cd /d %~dp0 java -jar ChunkyLauncher.jar --launcher pause
You can then right click the .bat file and create a shortcut which can be place on the desktop, pinned to the taskbar, etc.
For more advanced scripts please see the section on Automation