please help me, I've got a little program on JavaFX, it works good, so that I wanted to deliver it to users, including people without java at all. I build it to the Jar file, it works well with start.bat (where I add javafx modules to start), and last thing I must have a JRE folder in this folder. If I copy all folder with JRE17.0 it weight more than 400mb (but works well on the computers without java), and I know that my program could be have a size about 135mb with custom JRE. So, with jdeps I found all module dependences (successfully), and link it to the folder "java runtime", everything works well, jlink created folder with custom JRE with success. And when I start ready project on a computer without pre-installed java, with this custom JRE, I got such problem:
WARN StatusConsoleListener JNDI lookup class is not available because this JRE does not support JNDI. JNDI string lookups will not be available, continuing configuration. Ignoring java.lang.NoClassDefFoundError: javax/naming/Context Exception in Application start method
I even couldn't find similar problem in google... May be I forgot about some very important module, I don't know... I used this commands to create my custom JRE.
jdeps --ignore-missing-deps --list-deps --multi-release 17 --module-path libs --add-modules ALL-MODULE-PATH ExpensesViewer.jar
jlink --no-header-files --no-man-pages --compress=2 --strip-debug --module-path libs;javafx/lib --add-modules java.datatransfer,java.desktop,java.logging,java.management,java.net.http,java.scripting,java.sql,java.transaction.xa,java.xml,jdk.jsobject,jdk.unsupported,jdk.unsupported.desktop --output java-runtime
java version "17.0.2" 2022-01-18 LTS Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86) Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)
The classes javax.naming.*
are in module java.naming
, try adding module java.naming
to the list.