User Tools

Site Tools


doc:appunti:prog:java_compile_jar_command_line

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
doc:appunti:prog:java_compile_jar_command_line [2021/11/08 18:12] – [Download the included libraries] niccolodoc:appunti:prog:java_compile_jar_command_line [2021/11/08 18:15] – [Pack the Jar archive] niccolo
Line 22: Line 22:
  
  
-===== Download the required libraries =====+===== Where to put the required libraries =====
  
 The project files are layed-out hierarchically starting from the project's root directory; in our example the source files are into the path **org.vmax.amba**. The project files are layed-out hierarchically starting from the project's root directory; in our example the source files are into the path **org.vmax.amba**.
  
-We decided to put **the required libraries** into a **subdirectory** relative to the project's root directory; we created a subdirectory named **lib** and placed all the **.jar** archives into it. At runtime, the compiled jar archive will search the libraries starting from its directory, searching the same **lib** subdirectory:+We decided to put **the required libraries** into a **subdirectory** relative to the project's root directory; we created a subdirectory named **lib** and placed all the **.jar** archives into it. At runtime, the compiled jar archive will search the libraries starting from its directory, descending the same **lib** subdirectory:
  
 <file> <file>
Line 75: Line 75:
     $(find . -type f -name '*.class')     $(find . -type f -name '*.class')
 </code> </code>
 +
 +
 +===== Running the Java program from jar file =====
 +
 +Finally we can **start the Java program** from the jar archive:
 +
 +<code>
 +java -jar /path/java-program/firmware-editor-tool.jar
 +</code>
 +
 +Into the jar archive there is the **MANIFEST.MF** which will indicate where to search for the required libraries, relative to the same jar archive directory.
  
doc/appunti/prog/java_compile_jar_command_line.txt · Last modified: 2021/11/08 18:16 by niccolo