1
I created a Java application in Netbeans. This application has a GUI and uses some external Jars.
After doing Clean and Build in the Netbeans dist folder a Jar (main class) and a folder named lib (which has the external Jars I use) appeared. When running the Jar (main class) that is in the dist folder everything works normally. I checked the Class-Path and everything is OK. I even changed the name of the folder where the libs are and the program stopped giving, which means that the Jars in the lib folder are being used and not others.
The problem is that when copying the dist folder (which has the main class and the external Jars) to another computer (with the same version of Java installed) the program does not work.
Someone can help me?
Some jar is missing. To know which one I suggest you invoke your executable jar by cmd, so it will be possible to see which exception is being launched, because when it gives two clicks you have no feedback, correct?
– Math
If the dependencies are in a subdirectory, it means that when running Jar this directory must be being informed in some way to the JVM. Which classpath did you check? If it’s netbeans, it won’t be the same when the jar runs outside of that environment. Or maybe it is set to absolute instead of relative path. It would be interesting to post more information about your configuration.
– utluiz
Any error message? What is "program does not work"?
– Caffé
@Math One of the Jars used an auxiliary file that was missing...when I saw on the console I realized what the file was. Thanks.
– João Fonseca
@utluiz The class path I checked was the main jar
– João Fonseca
@Caffé program when booting used one of the auxiliary jars (lib) and this one used an auxiliary file that was not present.
– João Fonseca
@Joãofonseca So you’ve solved the problem?
– utluiz