How-to articles, tricks, and solutions about EXECUTABLE-JAR

How can I create an executable/runnable JAR with dependencies using Maven?

To create an executable JAR with dependencies using Maven, you can use the maven-assembly-plugin. This plugin allows you to package your project and its dependencies into a single JAR file.

How to get the path of a running JAR file?

To get the path of a running JAR file, you can use the java.lang.Class class's getProtectionDomain method and then the getCodeSource method.

Running JAR file on Windows

To run a JAR file on Windows, you will need to have the Java Runtime Environment (JRE) installed on your system. You can then run the JAR file by double-clicking it or by using the java command in the command prompt.