Launch a Scala Swing app on Windows without command window
It's clearly stated in the java
command explanation, about -jar
:
When you use this option, the JAR file is the source of all user classes, and other user class path settings are ignored.
Making a shortcut withjavaw.exe -cp "%SCALA_HOME%\lib\scala-library.jar";"%SCALA_HOME%\lib\scala-swing.jar";"C:/path/yourjar.jar" packageName.mainClassNamedid work.
The solution is hence include libraries + packaged target code with -cp
argument and don't use the -jar
switch. As also given as a solution in the question.