include external jar when running java -jar

Is there a reason why you are avoiding invoking the main class like java -cp /usr/local/jar/foobar.jar:/some/other/path.jar com.your.main.classname ? This type of invocation allows you to mix absolute paths with relative paths. Put this into a shell script or batch file to avoid having to actually type or remember the full classpath to simplify things.

Multiple runnable classes inside JAR, how to run them?

The executable Jar file format only allows you to specify one main class. In order for you to be able to execute different applications, you’ll need to either create a “manager” as you suggest, or to use the classpath instead: java -cp myjar.jar MyClass However, this approach will ignore the classpath you have configured in … Read more

Difference between the maven-assembly-plugin, maven-jar-plugin and maven-shade-plugin?

maven-jar-plugin: This plugin provides the capability to build and sign JARs. But it just compiles the java files under src/main/java and src/main/resources/. It doesn’t include the dependencies JAR files. maven-assembly-plugin: This plugin extracts all dependency JARs into raw classes and groups them together. It can also be used to build an executable JAR by specifying … Read more

Corrupt jar file

This will happen when you doubleclick a JAR file in Windows explorer, but the JAR is by itself actually not an executable JAR. A real executable JAR should have at least a class with a main() method and have it referenced in MANIFEST.MF. In Eclispe, you need to export the project as Runnable JAR file … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)