Yesterday I've finished to develop my java application and I had the same issue. If I double click the .jar file or I execute in a command line splash screen works perfectly, but when I execute the wrapped file it doesn't. Seems just JSmooth doesn't support this feature.
However I made a little trick to have a wrapped .exe
and splash screen working at the same time. I made a little application called ApplicationLoader.jar
that consists in a single main class that execute java -jar "Application.jar"
in a command line. Here is the complete code:
public class ApplicationLoader {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
/* First I check if the first parameter is not null and it's not an empty string */
if(args[0] != null && !args[0].trim().isEmpty()){
/* Then I use java.util.regex package to validate the parameter is a .jar file */
Pattern pattern = Pattern.compile(".*jar");
Matcher matcher = pattern.matcher(args[0]);
if(matcher.matches()){
/* Finally I define the command line like: java -jar "Application.jar" */
String command = "java -jar \"" + args[0] + "\"";
try {
Runtime r = Runtime.getRuntime();
ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/c", command);
Process p = pb.start();
p.waitFor();
} catch (IOException | InterruptedException ex) {
JOptionPane.showMessageDialog(null, ex.getMessage(), "Error executing: "+command, JOptionPane.ERROR_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(null, "The argument is not a .jar file!!");
}
} else {
JOptionPane.showMessageDialog(null, "There's not a valid argument!");
}
}
}
I have this folder structure for my application:
MyApp
+-- bin
| +-- MyApp.jar
| +-- ApplicationLoader.jar
+-- MyApp.exe
So in JSmoot
I changed the classpath to ApplicationLoader.jar
and add the relative location to my application in Application Arguments section like this:

And that's it. I know this is not the best option but is a workaround.
However there's a little problem:
Since ApplicationLoader.jar
calls a cmd.exe
then the wrapped .exe
and your application will execute in two different processes.
This implies that if you have to kill .exe
process for some reason (unexpected crash or something), your java application still working as a java.exe
process. So in that case you must kill MyApp.exe
and java.exe
processes. Actually if you just kill java.exe
process then MyApp.exe
process will finish execution by itself.
If you keep this in mind and you can live with that I think this option is quite simple and useful.
I hope this be helpful to anybody looking for a workaround to this issue.