Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I don't find your justification for doing this persuasive, but here's the way to make it work.</p> <p>Set the environment variables <code>_JAVA_SPLASH_JAR</code> to the file system path to the JAR that contains the splash screen image, and <code>_JAVA_SPLASH_FILE</code> to the name of the splash screen file within that JAR. For example, in a <code>bash</code> or <code>sh</code> shell, </p> <pre><code>(export _JAVA_SPLASH_JAR=app.jar; \ export _JAVA_SPLASH_FILE=META-INF/splash.jpg; \ java -cp app.jar com.y.app.Main ) </code></pre> <p>I think this approach is bad, because the environment variables are not documented as part of the <code>java</code> launcher interface, and implementation changes could break the splash screen or the entire launcher. </p> <p>The explanation for using it is flimsy. Of course you wouldn't want any circular dependencies between the common library and the applications. But this has nothing to do with the archive structure. Why go to the trouble of removing the compile-time dependencies from the combo main class on the applications, when it has a strong runtime dependency on them? </p> <p>This "common" main class is <em>not</em> part of the common library. It's another application. It would make more sense to allow it to have static dependencies on the applications, and to package it in a separate archive, with appropriate <code>Main-Class</code>, <code>Class-Path</code>, and <code>SplashScreen-Image</code> so that it can be launched with the <code>-jar</code> option. Then when your other applications are deployed individually, their common library won't contain the unnecessary combo application. And when a new version of Java is installed, the splash screen will display correctly instead of crashing the launcher.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload