How do I run a class in a WAR from the command line?

Similar to what Richard Detsch but with a bit easier to follow (works with packages as well) Step 1: Unwrap the War file. jar -xvf MyWar.war Step 2: move into the directory cd WEB-INF Step 3: Run your main with all dependendecies java -classpath “lib/*:classes/.” my.packages.destination.FileToRun

How to download sources for a jar with Maven?

2020 Update: The maven dependency plugin should be used whit the dependency:sources goal: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.1.1</version> <executions> <execution> <id>download-sources</id> <goals> <goal>sources</goal> </goals> <configuration> </configuration> </execution> </executions> </plugin> This can also be run from the command line as: mvn dependency:sources -Dsilent=true Executing mvn dependency:sources will force maven to download all sources of all jars in … Read more

Difference between maven plugins ( assembly-plugins , jar-plugins , shaded-plugins)

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

Registry Key ‘…’ has value ‘1.7’, but ‘1.6’ is required. Java 1.7 is Installed and the Registry is Pointing to it

This happens when you somehow confused java itself. You are trying to run a java 6 VM where it found a JRE 7. It might show this problem even if you type in the command line just java or java -version in a misconfigured environment. The JAR is not the problem, except in the very … Read more

How to make an executable JAR file?

A jar file is simply a file containing a collection of java files. To make a jar file executable, you need to specify where the main Class is in the jar file. Example code would be as follows. public class JarExample { public static void main(String[] args) { javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { … Read more

How to convert AAR to JAR

The AAR file consists of a JAR file and some resource files (it is basically a standard zip file with a custom file extension). Here are the steps to convert: Extract the AAR file using standard zip extract (rename it to *.zip to make it easier) Find the classes.jar file in the extracted files Rename … Read more

What exactly does a jar file contain?

A JAR file is actually just a ZIP file. It can contain anything – usually it contains compiled Java code (*.class), but sometimes also Java sourcecode (*.java). However, Java can be decompiled – in case the developer obfuscated his code you won’t get any useful class/function/variable names though.

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