Let us have a Java application, contained in files A.java
and B.java
with dependency on somejar.jar
file. The questions are:
how to create a self-runnable JAR file with all the dependencies and sources compiled within? The main condition is using the standard Java utilities only (given with JDK; e.g.:
java
,javac
andjar
) and NOT any of build tools like Maven, Ant or any other.how to use external JAR files within my application? For example, the algorithm is:
if the 'otherjar.jar' is present near the main application JAR, we should call method Moo::method1 from that class, passing the new instance of Foo class to it. Moo and Foo should be present in 'otherjar.jar' file. Still, the 'config.xml' file should be there too
.