Skip to content

Commit 0ac1a2d

Browse files
authored
Merge pull request #30 from BlankSpacePlus/master
Update README.md
2 parents d2fa20f + e0a16a4 commit 0ac1a2d

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ All the codes run with Java 14 with the preview features enabled.
4848
Each chapter comes with executable examples that you can run using jshell.
4949

5050
To get the examples, just clone this repository
51-
```
52-
git clone http://github.com/forax/java-guide
51+
```shell
52+
git clone http://github.com/forax/java-guide
5353
```
5454

5555
Then run jshell (at least Java 14 version)
56-
```
57-
jshell --enable-preview
56+
```shell
57+
jshell --enable-preview
5858
```
5959

6060
Then you can copy paste the examples inside jshell and see by yourself.
@@ -73,51 +73,51 @@ You can run it directly in your browser
7373
You need to have docker already installed, then
7474

7575
- get the docker image from dockerhub
76-
```
77-
docker pull forax/java-guide
76+
```shell
77+
docker pull forax/java-guide
7878
```
7979
- run the docker image in a container
80+
```shell
81+
docker run -p 8888:8888 forax/java-guide
8082
```
81-
docker run -p 8888:8888 forax/java-guide
83+
- open your browser using the `tokenId` printed on the console
84+
```shell
85+
firefox http://localhost:8888/?token=tokenId
8286
```
83-
- open your browser using the `tokenId` printed on the console
84-
```
85-
firefox http://localhost:8888/?token=tokenId
86-
```
8787

8888

8989
### or install everything on your laptop
9090
You need to have python3 and Java 14 already installed, then
9191

9292
- clone this repository
93-
```
94-
git clone http://github.com/forax/java-guide
95-
cd java-guide
93+
```shell
94+
git clone http://github.com/forax/java-guide
95+
cd java-guide
9696
```
9797
- install [jupyter](https://jupyter.org/install)
98-
```
99-
pip install notebook
98+
```shell
99+
pip install notebook
100100
```
101101
- install the [ijava 1.3.0](https://github.com/SpencerPark/IJava) kernel (from Spencer Park)
102-
```
102+
```shell
103103
wget https://github.com/SpencerPark/IJava/releases/download/v1.3.0/ijava-1.3.0.zip
104104
python3 install.py --sys-prefix
105105
```
106-
- patch it with the repository file `kernel.json`
106+
- patch it with the repository file `kernel.json`<br>
107107
list all kernels to see if the java kernel is installed
108-
```
108+
```shell
109109
jupyter kernelspec list
110110
```
111111
then copy the file `kernel.json` from the folder `docker` to the java kernel directory
112-
```
112+
```shell
113113
cp docker/kernel.json /path/to/jupyter/kernels/java
114114
```
115115
- set the env compiler option enabling the preview features
116-
```
116+
```shell
117117
export IJAVA_COMPILER_OPTS="--enable-preview -source 14"
118118
```
119119
- run the notebook
120-
```
120+
```shell
121121
cd jupyter
122122
jupyter notebook
123123
```
@@ -128,6 +128,6 @@ The markdown files (.md) and the jupyter files (.ipynb) are derived/generated
128128
from the jshell files using a small Java script.
129129

130130
Using java 14
131-
```
132-
java --source 14 --enable-preview build/build.java
131+
```shell
132+
java --source 14 --enable-preview build/build.java
133133
```

0 commit comments

Comments
 (0)