doc:appunti:prog:java_compile_jar_command_line
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
doc:appunti:prog:java_compile_jar_command_line [2021/11/08 17:37] – [Pack the Jar archive] niccolo | doc:appunti:prog:java_compile_jar_command_line [2021/11/08 18:16] (current) – [Running the Java program from jar file] niccolo | ||
---|---|---|---|
Line 22: | Line 22: | ||
- | ===== Download | + | ===== Where to put the required |
- | It is advisable | + | The project files are layed-out hierarchically starting from the project' |
+ | |||
+ | We decided | ||
< | < | ||
Line 43: | Line 45: | ||
| | ||
</ | </ | ||
+ | |||
+ | This may not be the optimal solution, because jar libraries are not installed system-wide and thus they are not shared among other Java programs. This recipe has the advantage that the installation of the Java program and the required libraries can be accomplished by an **unprivileged user** in its home directory. | ||
+ | |||
===== Compile the Java code ===== | ===== Compile the Java code ===== | ||
Line 70: | Line 75: | ||
$(find . -type f -name ' | $(find . -type f -name ' | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Running the Java program from jar file ===== | ||
+ | |||
+ | Finally we can **start the Java program** from the jar archive: | ||
+ | |||
+ | < | ||
+ | java -jar / | ||
+ | </ | ||
+ | |||
+ | Into the jar archive there is the **MANIFEST.MF** file, 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.1636389462.txt.gz · Last modified: 2021/11/08 17:37 by niccolo