forked from AdoptOpenJDK/jdk9-jigsaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Renamed a number of exercises, hence changes to folder names and re…
…ferences in the README.md - Also added the final exercise for JMod - Corrected an important message about the distributable
- Loading branch information
1 parent
1f92998
commit 2411391
Showing
37 changed files
with
102 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### The JMod example | ||
|
||
This example shows how to use `jmod`, `jmod` is a tool used to package modules or package jars into a compress file which is still different from a jar format. | ||
|
||
It is similar to the `jimage` format but not distributed run-time, its not certain of its application yet. | ||
|
||
**Note:** in case one of the below `.sh` script fails due to the `tree` command, please take a look at [Download and install the `tree` and `wget` command](../../README.md) section in the README.md file and apply the appropriate solution. | ||
|
||
Modules involved just like in the previous example: | ||
``` | ||
com.greetings | ||
org.astro | ||
``` | ||
|
||
Both the modules are compiled together from the sources into the folder `mods` with the following commands: | ||
|
||
$ ./compile.sh | ||
|
||
And we run the `JMod` command with the following command: | ||
|
||
$ ./runJMod.sh | ||
|
||
Check the contents of both these script files (use the `cat` command or a text editor) to see what they are doing and why - interesting instructions and information in there. | ||
|
||
See [../01_Greetings/README.md](../01_Greetings/README.md) to learn more about package and module naming conventions and how to avoid confusions between them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
# Escape code | ||
esc=$(echo -en "\033") | ||
|
||
info="${esc}[0;33m" | ||
normal=$(echo -en "${esc}[m\017") | ||
|
||
runTree() | ||
{ | ||
if [[ "$OSTYPE" == "cygwin" ]] || [[ "$OSTYPE" == "msys" ]] ; then | ||
cmd //c "tree /f /a $1" | ||
else | ||
tree -fl $1 | ||
fi | ||
} | ||
|
||
COM_GREETINGS_FOLDER="mods/com.greetings" | ||
ORG_ASTRO_FOLDER="mods/org.astro" | ||
|
||
echo "" | ||
echo "${info} *** Compiling modules in $ORG_ASTRO_FOLDER *** ${normal}" | ||
javac -d $ORG_ASTRO_FOLDER \ | ||
src/org.astro/module-info.java \ | ||
src/org.astro/org/astro/World.java | ||
|
||
echo "" | ||
echo "${info} *** Displaying the contents (modules) of the '$ORG_ASTRO_FOLDER' folder *** ${normal}" | ||
runTree "$ORG_ASTRO_FOLDER" | ||
|
||
echo "" | ||
echo "${info} *** Compiling modules in $COM_GREETINGS_FOLDER *** ${normal}" | ||
javac --module-path mods \ | ||
-d $COM_GREETINGS_FOLDER \ | ||
src/com.greetings/module-info.java \ | ||
src/com.greetings/com/greetings/Main.java | ||
|
||
echo "" | ||
echo "${info} *** Displaying the contents (modules) of the '$COM_GREETINGS_FOLDER' folder *** ${normal}" | ||
runTree "$COM_GREETINGS_FOLDER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
|
||
# Escape code | ||
esc=$(echo -en "\033") | ||
|
||
info="${esc}[0;33m" | ||
normal=$(echo -en "${esc}[m\017") | ||
|
||
echo "" | ||
echo "${info} *** Removing any existing greetings.jmod *** ${normal}" | ||
rm -f greetings.jmod | ||
|
||
echo | ||
echo "" | ||
echo "${info} *** Creating a module (greetings.jmod) from multiple modules / packages / classes with jlink. *** ${normal}" | ||
jmod create \ | ||
--class-path mods/com.greetings:mods/org.astro \ | ||
greetings.jmod | ||
|
||
echo "" | ||
echo "${info} *** Enlisting the contents of the module (greetings.jmod) *** ${normal}" | ||
jmod list greetings.jmod | ||
|
||
|
||
echo "${info} *** Currently JMOD files can be used at compile time and link time, but not at run time. *** ${normal}" | ||
echo "${info} *** Read further about JMod files at http://openjdk.java.net/jeps/261#Packaging:-JMOD-files *** ${normal}" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.