From bcdb5c0ab35c9a1f1367dcf81f444ed09539d5db Mon Sep 17 00:00:00 2001 From: JasonHomeWorkstationUbuntu Date: Sat, 25 Jul 2020 18:26:43 +1000 Subject: [PATCH] Added lesson2 --- .gitmodules | 3 +++ Core_JAVA_Volume1 | 1 + Dockerfile | 5 +++++ lesson2.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 .gitmodules create mode 160000 Core_JAVA_Volume1 create mode 100644 Dockerfile create mode 100644 lesson2.md diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c57b043 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Core_JAVA_Volume1"] + path = Core_JAVA_Volume1 + url = git@github.com:specter01wj/Core_JAVA_Volume1.git diff --git a/Core_JAVA_Volume1 b/Core_JAVA_Volume1 new file mode 160000 index 0000000..8ca9c76 --- /dev/null +++ b/Core_JAVA_Volume1 @@ -0,0 +1 @@ +Subproject commit 8ca9c76bf17e49e0d4654973fff7889caf4644e8 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e7952a6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:slim-buster +COPY Core_JAVA_Volume1/corejava/v1ch02/ImageViewer /usr/src/myapp +WORKDIR /usr/src/myapp +RUN javac ImageViewer.java +CMD ["java", "ImageViewer"] \ No newline at end of file diff --git a/lesson2.md b/lesson2.md new file mode 100644 index 0000000..cfc9c79 --- /dev/null +++ b/lesson2.md @@ -0,0 +1,43 @@ +# Lesson 2: The Java Programming Environment + +## Run as server + +For headless application (run as server), we can use docker. + +After create `FILE.java`, create a `Dockerfile` + +``` +FROM openjdk:slim-buster +COPY