A guide to modern Java (Java 17)
This guide is about learning Java from scratch if you know a bit of C or JavaScript.
This is a Work in progress, it should be ready when the next LTS of Java (Java 17) will be released. All the codes run with Java 14 with the preview features enabled.
Note: if you are looking to only what's new in Java 14 I have set of slides for that.
Each chapter comes with executable examples that you can run using jshell.
To get the examples, just clone this repository
git clone http://github.com/forax/java-guide
Then run jshell (at least Java 14 version)
jshell --enable-preview
Then you can copy paste the examples inside jshell and see by yourself.
To quit use '/exit', to enable verbose error messages '/set feedback verbose', otherwise to get the help type '/help'
You can run it directly in your browser
You need to have docker already installed, then
docker pull forax/java-guide
docker run -p 8888:8888 forax/java-guide
tokenId printed on the console
firefox http://localhost:8888/?token=tokenId
You need to have python3 and Java 14 already installed, then
git clone http://github.com/forax/java-guide
cd java-guide
pip install notebook
wget https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip
python3 install.py --sys-prefix
kernel.json
list all kernels to see if the java kernel is installed
jupyter kernelspec list
kernel.json from the folder docker to the java kernel directory
cp docker/kernel.json /path/to/jupyter/kernels/java
export IJAVA_COMPILER_OPTS="--enable-preview -source 14"
cd jupyter
jupyter notebook
The markdown files (.md) and the jupyter files (.ipynb) are derived/generated from the jshell files using a small Java script.
Using java 14
java --source 14 --enable-preview build/build.java
Content type
Image
Digest
Size
514.6 MB
Last updated
about 6 years ago
docker pull forax/java-guide