This repository accompanies book Java for Absolute Beginners (https://link.springer.com/book/10.1007/978-1-4842-7080-6) by Iuliana Cosmina(Apress, 2018).
Download the files as a zip using the green button, or clone the repository to your machine using Git.
Release v2.0 corresponds to the code in the second edition of the published book, without corrections or updates. This project was built successfully with JDK versions 17 and Maven version 3.8.2. The syntax is specific to Java versions up to and including 17. (Unstable(preview) features have not been covered in the book)
For corrections to the content in the published book, see the file Errata.adoc.
See the file Contributing.adoc for more information on how you can contribute to this repository.
This is a Maven multi-module project. Build it from scratch using:
mvn clean install
Build it without tests using:
mvn clean install -DskipTests
The default Maven goal is set to:
clean install site
This allows you to build the project and generate the site for it just by running mvn
, at the root of the project.
If you want to generate and run the project site run
mvn clean install site site:stage site:run -Pdocs
This project does not require installing Apache Maven, because it was configured to be run with an Apache Maven Wrapper. All previous commands can be run with ./mvnw
instead of mvn
.
The docs
maven profile excludes a few modules from generating docs, because of failures caused by non-modular dependencies and plugin incompatibilities.
If you want to build the project using a Docker container, a Dockerfile is provided to you. Just build the image using the following command (the 5th step is Maven build):
docker build -t java-17-bgn .
If you want to inspect the image contents, run the container image using:
docker run -it -p 9000:9000 --name java-17-bgn-build -v ${PWD}:/usr/src/java-17-for-absolute-beginners java-17-bgn
Or if you are using a Linux/Unix system just execute the build-and-serve.sh
provided with this project and the Docker image will be built, a container will be started and used to build the project and serve the docs at http://localhost:9000/. It might take a while, but it gets the job done.