In November 2019, I attended Devoxx Belgium together with other AMIS colleagues. The yearly gathering of over 3000 Java developers (numbers provided by Devoxx website) were Java and software development are the core themes.
At Devoxx, among other things, I learned about Quarkus and wanted to know more about it.
In this article I will share with you the steps I took, to set up a demo environment, so I could get started with Quarkus.
Quarkus
A Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards.
[https://quarkus.io/]
Container first
From the outset Quarkus has been designed around a container first philosophy. What this means in real terms is that Quarkus is optimised for low memory usage and fast startup times in the following ways:
- First Class Support for Graal/SubstrateVM
Substrate support has been an important part of the design for Quarkus from the beginning. When an application is compiled down to a native image it starts much faster and can run with a much smaller heap than a standard JVM. Quarkus are all tested in Substrate, and can run without the -H:+ReportUnsupportedElementsAtRuntime flag.
- Build Time Metadata Processing
As much processing as possible is done at build time, so your application will only contain the classes that are actually needed at runtime. In a traditional model all the classes required to perform the initial application deployment hang around for the life of the application, even though they are only used once. With Quarkus they are not even loaded into the production JVM. This results in less memory usage, and also faster startup time as all metadata processing has already been done.
- Reduction in Reflection Usage
As much as possible Quarkus tries to avoid reflection, reducing startup time and memory usage.
- Native Image Pre Boot
When running in a native image Quarkus pre-boots as much of the framework as possible during the native image build process. This means that the resulting native image has already run most of the startup code and serialized the result into the executable, resulting in even faster startup.
[https://quarkus.io/vision/container-first]
Unifies imperative and reactive
Combine both the familiar imperative code and the non-blocking reactive style when developing applications.
For years, the client-server architecture has been the de-facto standard to build applications. But a major shift happened. The one model rules them all age is over. A new range of applications and architecture styles has emerged and impacts how code is written and how applications are deployed and executed. HTTP microservices, reactive applications, message-driven microservices and serverless are now central players in modern systems.
Quarkus has been designed with this new world in mind, and provides first-class support for these different paradigms. Quarkus development model morphs to adapt itself to the type of application you are developing.
[https://quarkus.io/vision/continuum]
Developer joy
A cohesive platform for optimized developer joy:
- Unified configuration
- Zero config, live reload in the blink of an eye
- Streamlined code for the 80% common usages, flexible for the 20%
- No hassle native executable generation
Best-of-breed libraries and standards
Quarkus provides a cohesive, fun to use, full-stack framework by leveraging a growing list of over fifty best-of-breed libraries that you love and use. All wired on a standard backbone. Learn more about Quarkus Extensions.
[https://quarkus.io/vision/standards]
Quarkus is open. All dependencies of this project are available under the Apache Software License 2.0 or compatible license.
[https://quarkus.io/]
Quarkus at Devoxx Belgium 2019
Below, you can see the sessions about Quarkus at Devoxx Belgium 2019:
Birds of a Feather (Informal evening sessions of one hour, where like minded people get together and discuss technology):
- “Quarkus Community BOF” by Georgios Andrianakis, Dimitris Andreadis, Emmanuel Bernard, Kamesh Sampath (Server Side Java)
Conference (Tech sessions of 50 minutes on a range of different technologies, practices and methodologies):
By the way, my colleague Lucas Jellema, wrote an article with the title “The state of Java [developers] – reflections on Devoxx 2019”.
[https://technology.amis.nl/2019/11/11/the-state-of-java-developers-reflections-on-devoxx-2019/]
Please see https://devoxx.com/#/ for more information about Devoxx events, also in other places in the world.
And I also wanted to mention that Devoxx Belgium 2020 is canceled.
Devoxx should be a place of joy, socialising and fun… not a place where people are afraid of getting infected. As a result we decided to cancel this years edition of Devoxx Belgium.
The next Devoxx Belgium is scheduled November 8th – 12th 2021.
[https://devoxx.be/]
GraalVM
GraalVM is a high-performance runtime that provides significant improvements in application performance and efficiency which is ideal for microservices. It is designed for applications written in Java, JavaScript, LLVM-based languages such as C and C++, and other dynamic languages. It removes the isolation between programming languages and enables interoperability in a shared runtime. It can run either standalone or in the context of OpenJDK, Node.js or Oracle Database.
[https://www.graalvm.org/getting-started/]
Quarkus – get started
In order to get started with Quarkus, there are some steps to be taken as can be seen in the picture above.
[https://quarkus.io/get-started/]
As I did before, on my Windows laptop, I wanted to use a demo environment within an Oracle VirtualBox appliance, with the help of Vagrant.
Based on the Quarkus guides I wanted to try out, I knew I also was going to need Kubernetes.
[https://quarkus.io/guides/deploying-to-kubernetes]
So, again I created a demo environment with K3s (with the Kubernetes Dashboard) on top of an Ubuntu guest Operating System within an Oracle VirtualBox appliance, in a similar way I described in a previous article.
[ https://technology.amis.nl/2020/01/15/rapidly-spinning-up-a-vm-with-ubuntu-and-k3s-with-the-kubernetes-dashboard-on-my-windows-laptop-using-vagrant-and-oracle-virtualbox/]
Once I had that up and running, I would extend it with the software mentioned in the steps above. But more about that, later on in this article.
For K3s (lightweight certified Kubernetes distribution) this time I wanted to use the Docker container runtime instead of containerd.
I had a look at the K3s documentation and found I had to do the following:
[https://rancher.com/docs/k3s/latest/en/advanced/#using-docker-as-the-container-runtime]
I also wanted to be able to use Docker as a non-root user.
[https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user]
So, based on the steps mentioned above, in the scripts directory I changed the content of the file k3s.sh to:
#!/bin/bash
echo "**** Begin installing k3s"
#Install
curl https://releases.rancher.com/install-docker/19.03.sh | sh
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s - --docker
# Wait 2 minutes
echo "**** Waiting 2 minutes ..."
sleep 120
#List nodes
echo "**** List nodes"
kubectl get nodes
echo "**** List pods"
sudo k3s kubectl get pods --all-namespaces
echo "**** List Docker containers"
sudo docker ps
#use Docker as a non-root user
sudo usermod -aG docker vagrant
echo "**** End installing k3s"
In my existing demo environment, created when I wrote a previous article , I changed the content of the Vagrantfile to:
[https://technology.amis.nl/2020/01/15/rapidly-spinning-up-a-vm-with-ubuntu-and-k3s-with-the-kubernetes-dashboard-on-my-windows-laptop-using-vagrant-and-oracle-virtualbox/]
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.define "ubuntu_k3s" do |ubuntu_k3s|
config.vm.network "forwarded_port",
guest: 8001,
host: 8001,
auto_correct: true
config.vm.network "forwarded_port",
guest: 8080,
host: 8080,
auto_correct: true
config.vm.network "forwarded_port",
guest: 8090,
host: 8090,
auto_correct: true
config.vm.provider "virtualbox" do |vb|
vb.name = "Ubuntu k3s"
vb.memory = "8192"
vb.cpus = "1"
args = []
config.vm.provision "k3s shell script", type: "shell",
path: "scripts/k3s.sh",
args: args
args = []
config.vm.provision "helm shell script", type: "shell",
path: "scripts/helm.sh",
args: args
args = []
config.vm.provision "dashboard shell script", type: "shell",
path: "scripts/dashboard.sh",
args: args
end
end
end
Here, you can see I added some ports needed for the Quarkus guided code examples, later on.
From the subdirectory named env on my Windows laptop, I opened a Windows Command Prompt (cmd) and typed: vagrant up
This command creates and configures guest machines according to your Vagrantfile.
[https://www.vagrantup.com/docs/cli/up.html]
With the following output (only showing the part about K3s):
ubuntu_k3s: **** Begin installing k3s
ubuntu_k3s:
…
ubuntu_k3s: Processing triggers for ureadahead (0.100.0-21) …
ubuntu_k3s: +
ubuntu_k3s: sh
ubuntu_k3s: -c
ubuntu_k3s: docker version
ubuntu_k3s: Client: Docker Engine – Community
ubuntu_k3s: Version:
ubuntu_k3s: 19.03.12
ubuntu_k3s: API version: 1.40
ubuntu_k3s: Go version: go1.13.10
ubuntu_k3s: Git commit: 48a66213fe
ubuntu_k3s: Built: Mon Jun 22 15:45:36 2020
ubuntu_k3s: OS/Arch: linux/amd64
ubuntu_k3s: Experimental: false
ubuntu_k3s: Server: Docker Engine – Community
ubuntu_k3s: Engine:
ubuntu_k3s: Version: 19.03.12
ubuntu_k3s: API version: 1.40 (minimum version 1.12)
ubuntu_k3s: Go version: go1.13.10
ubuntu_k3s: Git commit: 48a66213fe
ubuntu_k3s: Built: Mon Jun 22 15:44:07 2020
ubuntu_k3s: OS/Arch: linux/amd64
ubuntu_k3s: Experimental: false
ubuntu_k3s: containerd:
ubuntu_k3s: Version: 1.2.13
ubuntu_k3s: GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
ubuntu_k3s: runc:
ubuntu_k3s: Version: 1.0.0-rc10
ubuntu_k3s: GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
ubuntu_k3s: docker-init:
ubuntu_k3s: Version: 0.18.0
ubuntu_k3s: GitCommit: fec3683
ubuntu_k3s:
ubuntu_k3s: If you would like to use Docker as a non-root user, you should now consider
ubuntu_k3s: adding your user to the “docker” group with something like:
ubuntu_k3s:
ubuntu_k3s: sudo usermod -aG docker your-user
ubuntu_k3s:
ubuntu_k3s: Remember that you will have to log out and back in for this to take effect!
ubuntu_k3s:
ubuntu_k3s: WARNING: Adding a user to the “docker” group will grant the ability to run
ubuntu_k3s: containers which can be used to obtain root privileges on the
ubuntu_k3s: docker host.
ubuntu_k3s: Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface
ubuntu_k3s: for more information.
ubuntu_k3s: [INFO] Finding release for channel stable
ubuntu_k3s: [INFO] Using v1.18.6+k3s1 as release
ubuntu_k3s: [INFO] Downloading hash https://github.com/rancher/k3s/releases/download/v1.18.6+k3s1/sha256sum-amd64.txt
ubuntu_k3s: [INFO] Downloading binary https://github.com/rancher/k3s/releases/download/v1.18.6+k3s1/k3s
ubuntu_k3s: [INFO] Verifying binary download
ubuntu_k3s: [INFO] Installing k3s to /usr/local/bin/k3s
ubuntu_k3s: [INFO] Creating /usr/local/bin/kubectl symlink to k3s
ubuntu_k3s: [INFO] Creating /usr/local/bin/crictl symlink to k3s
ubuntu_k3s: [INFO] Skipping /usr/local/bin/ctr symlink to k3s, command exists in PATH at /usr/bin/ctr
ubuntu_k3s: [INFO] Creating killall script /usr/local/bin/k3s-killall.sh
ubuntu_k3s: [INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh
ubuntu_k3s: [INFO] env: Creating environment file /etc/systemd/system/k3s.service.env
ubuntu_k3s: [INFO] systemd: Creating service file /etc/systemd/system/k3s.service
ubuntu_k3s: [INFO] systemd: Enabling k3s unit
ubuntu_k3s: Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
ubuntu_k3s: [INFO] systemd: Starting k3s
ubuntu_k3s: **** Waiting 2 minutes …
ubuntu_k3s: **** List nodes
ubuntu_k3s: NAME
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: STATUS
ubuntu_k3s:
ubuntu_k3s: ROLES
ubuntu_k3s:
ubuntu_k3s: AGE
ubuntu_k3s:
ubuntu_k3s: VERSION
ubuntu_k3s: ubuntu-bionic
ubuntu_k3s:
ubuntu_k3s: Ready
ubuntu_k3s: master 2m v1.18.6+k3s1
ubuntu_k3s: **** List pods
ubuntu_k3s: NAMESPACE
ubuntu_k3s:
ubuntu_k3s: NAME
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: READY
ubuntu_k3s:
ubuntu_k3s: STATUS
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: RESTARTS AGE
ubuntu_k3s: kube-system local-path-provisioner-6d59f47c7-qvdmm 1/1 Running 0 112s
ubuntu_k3s: kube-system coredns-8655855d6-mbgvq 1/1 Running 0 112s
ubuntu_k3s: kube-system metrics-server-7566d596c8-dcf7s 1/1 Running 0 112s
ubuntu_k3s: kube-system svclb-traefik-kzwvv 0/2 ContainerCreating 0 29s
ubuntu_k3s: kube-system helm-install-traefik-sk5fg 0/1 Completed 3 112s
ubuntu_k3s: kube-system traefik-758cd5fc85-z4qc6 0/1 Running 0 29s
ubuntu_k3s: **** List Docker containers
ubuntu_k3s: CONTAINER ID
ubuntu_k3s:
ubuntu_k3s: IMAGE
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: COMMAND
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: CREATED
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: STATUS
ubuntu_k3s:
ubuntu_k3s:
ubuntu_k3s: PORTS NAMES
ubuntu_k3s: 0333a6f0fbd2 897ce3c5fc8f “entry” 1 second ago Up Less than a second k8s_lb-port-443_svclb-traefik-kzwvv_kube-system_846ce2d8-50ff-4a30-88c0-ffb9327fff03_0
ubuntu_k3s: 6d085d1fe4d8 rancher/klipper-lb “entry” 2 seconds ago Up 1 second k8s_lb-port-80_svclb-traefik-kzwvv_kube-system_846ce2d8-50ff-4a30-88c0-ffb9327fff03_0
ubuntu_k3s: bae3746c5344 rancher/library-traefik “/traefik –configfi…” 9 seconds ago Up 7 seconds k8s_traefik_traefik-758cd5fc85-z4qc6_kube-system_cdcea26f-e6f5-4b08-a93f-7fa9514100d8_0
ubuntu_k3s: 1aa8e957cf75 rancher/pause:3.1 “/pause” 28 seconds ago Up 26 seconds k8s_POD_traefik-758cd5fc85-z4qc6_kube-system_cdcea26f-e6f5-4b08-a93f-7fa9514100d8_0
ubuntu_k3s: 4050f6c41033 rancher/pause:3.1 “/pause” 28 seconds ago Up 26 seconds
ubuntu_k3s:
ubuntu_k3s: k8s_POD_svclb-traefik-kzwvv_kube-system_846ce2d8-50ff-4a30-88c0-ffb9327fff03_0
ubuntu_k3s: 0e5122a93a6c rancher/metrics-server “/metrics-server” 58 seconds ago Up 58 seconds
ubuntu_k3s: k8s_metrics-server_metrics-server-7566d596c8-dcf7s_kube-system_e889e47a-6dc2-4153-8f6d-6eb26aa26b42_0
ubuntu_k3s: eadc6c496348 rancher/local-path-provisioner “local-path-provisio…” About a minute ago Up About a minute k8s_local-path-provisioner_local-path-provisioner-6d59f47c7-qvdmm_kube-system_14cb4b03-9a4d-4418-9033-f44c88232b98_0
ubuntu_k3s: 2164fc3be928 rancher/coredns-coredns “/coredns -conf /etc…” About a minute ago Up About a minute k8s_coredns_coredns-8655855d6-mbgvq_kube-system_caf5cd7c-d511-45c7-a2d2-9852b199d1f2_0
ubuntu_k3s: 28776d7c5bb7 rancher/pause:3.1 “/pause” About a minute ago Up About a minute k8s_POD_metrics-server-7566d596c8-dcf7s_kube-system_e889e47a-6dc2-4153-8f6d-6eb26aa26b42_0
ubuntu_k3s: 3e5a22d6a85a rancher/pause:3.1 “/pause” About a minute ago Up About a minute k8s_POD_coredns-8655855d6-mbgvq_kube-system_caf5cd7c-d511-45c7-a2d2-9852b199d1f2_0
ubuntu_k3s: 73e925c1ddcf rancher/pause:3.1 “/pause” About a minute ago Up About a minute k8s_POD_local-path-provisioner-6d59f47c7-qvdmm_kube-system_14cb4b03-9a4d-4418-9033-f44c88232b98_0
ubuntu_k3s: **** End installing k3s
I used vagrant ssh to connect into the running VM. Next, I used the following command on the Linux Command Prompt:
docker --version
With the following output:
Docker version 19.03.12, build 48a66213fe
This gave me the version of Docker, but also showed me, I could use Docker as a non-root user (being user vagrant).
Next, I continued with the steps to get started with Quarkus.
Step 1 You need an IDE
I installed IntelliJ IDEA Community Edition 2020.2 on my Windows laptop.
[https://www.jetbrains.com/idea/download/#section=windows]
Step 2a You need a JDK 8 or 11+ (any distribution)
On the “QUARKUS – GET STARTED” page, I clicked on the link “a JDK 8 or 11+” in step 2.
[https://adoptopenjdk.net/]
From there I clicked on the link “Installation”.
[https://adoptopenjdk.net/installation.html]
From here I could have downloaded the tar.gz file, suitable for my environment:
https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.8%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.8_10.tar.gz
But on the “Installation” page, I navigated to the Installers, and more specific to part about the Linux DEB installer packages.
So, I used the following command on the Linux Command Prompt:
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
With the following output:
OK
Next, I used the following command on the Linux Command Prompt:
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
With the following output:
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:4 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bionic InRelease [6155 B]
Get:5 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bionic/main amd64 Packages [11.3 kB]
Hit:6 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:7 http://security.ubuntu.com/ubuntu bionic-security InRelease
Fetched 17.5 kB in 5s (3273 B/s)
Reading package lists… Done
Next, I used the following command on the Linux Command Prompt:
sudo apt-get update
With the following output:
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 https://download.docker.com/linux/ubuntu bionic InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:6 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bionic InRelease
Reading package lists… Done
Next, I used the following command on the Linux Command Prompt:
sudo apt-get install -y adoptopenjdk-11-hotspot
With the following output:
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
java-common libasound2 libasound2-data libxi6 libxrender1 libxtst6 x11-common
Suggested packages:
default-jre libasound2-plugins alsa-utils
The following NEW packages will be installed:
adoptopenjdk-11-hotspot java-common libasound2 libasound2-data libxi6 libxrender1 libxtst6 x11-common
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 194 MB of archives.
After this operation, 325 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 java-common all 0.68ubuntu1~18.04.1 [14.5 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libasound2-data all 1.1.3-5ubuntu0.5 [38.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libasound2 amd64 1.1.3-5ubuntu0.5 [360 kB]
Get:4 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxi6 amd64 2:1.7.9-1 [29.2 kB]
Get:5 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxrender1 amd64 1:0.9.10-1 [18.7 kB]
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 x11-common all 1:7.7+19ubuntu7.1 [22.5 kB]
Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 libxtst6 amd64 2:1.2.3-1 [12.8 kB]
Get:8 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bionic/main amd64 adoptopenjdk-11-hotspot amd64 11.0.8+10-2 [194 MB]
Fetched 194 MB in 1min 34s (2070 kB/s)
Selecting previously unselected package java-common.
(Reading database … 65681 files and directories currently installed.)
Preparing to unpack …/0-java-common_0.68ubuntu1~18.04.1_all.deb …
Unpacking java-common (0.68ubuntu1~18.04.1) …
Selecting previously unselected package libasound2-data.
Preparing to unpack …/1-libasound2-data_1.1.3-5ubuntu0.5_all.deb …
Unpacking libasound2-data (1.1.3-5ubuntu0.5) …
Selecting previously unselected package libasound2:amd64.
Preparing to unpack …/2-libasound2_1.1.3-5ubuntu0.5_amd64.deb …
Unpacking libasound2:amd64 (1.1.3-5ubuntu0.5) …
Selecting previously unselected package libxi6:amd64.
Preparing to unpack …/3-libxi6_2%3a1.7.9-1_amd64.deb …
Unpacking libxi6:amd64 (2:1.7.9-1) …
Selecting previously unselected package libxrender1:amd64.
Preparing to unpack …/4-libxrender1_1%3a0.9.10-1_amd64.deb …
Unpacking libxrender1:amd64 (1:0.9.10-1) …
Selecting previously unselected package x11-common.
Preparing to unpack …/5-x11-common_1%3a7.7+19ubuntu7.1_all.deb …
dpkg-query: no packages found matching nux-tools
Unpacking x11-common (1:7.7+19ubuntu7.1) …
Selecting previously unselected package libxtst6:amd64.
Preparing to unpack …/6-libxtst6_2%3a1.2.3-1_amd64.deb …
Unpacking libxtst6:amd64 (2:1.2.3-1) …
Selecting previously unselected package adoptopenjdk-11-hotspot.
Preparing to unpack …/7-adoptopenjdk-11-hotspot_11.0.8+10-2_amd64.deb …
Unpacking adoptopenjdk-11-hotspot (11.0.8+10-2) …
Setting up libxi6:amd64 (2:1.7.9-1) …
Setting up libasound2-data (1.1.3-5ubuntu0.5) …
Setting up java-common (0.68ubuntu1~18.04.1) …
Setting up libasound2:amd64 (1.1.3-5ubuntu0.5) …
Setting up libxrender1:amd64 (1:0.9.10-1) …
Setting up x11-common (1:7.7+19ubuntu7.1) …
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Setting up libxtst6:amd64 (2:1.2.3-1) …
Setting up adoptopenjdk-11-hotspot (11.0.8+10-2) …
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jaotc to provide /usr/bin/jaotc (jaotc) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jar to provide /usr/bin/jar (jar) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jarsigner to provide /usr/bin/jarsigner (jarsigner) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/javac to provide /usr/bin/javac (javac) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/javadoc to provide /usr/bin/javadoc (javadoc) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/javap to provide /usr/bin/javap (javap) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jcmd to provide /usr/bin/jcmd (jcmd) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jdb to provide /usr/bin/jdb (jdb) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jdeprscan to provide /usr/bin/jdeprscan (jdeprscan) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jdeps to provide /usr/bin/jdeps (jdeps) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jhsdb to provide /usr/bin/jhsdb (jhsdb) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jimage to provide /usr/bin/jimage (jimage) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jinfo to provide /usr/bin/jinfo (jinfo) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jlink to provide /usr/bin/jlink (jlink) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jmap to provide /usr/bin/jmap (jmap) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jmod to provide /usr/bin/jmod (jmod) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jps to provide /usr/bin/jps (jps) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jrunscript to provide /usr/bin/jrunscript (jrunscript) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jshell to provide /usr/bin/jshell (jshell) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jstack to provide /usr/bin/jstack (jstack) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jstat to provide /usr/bin/jstat (jstat) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/jstatd to provide /usr/bin/jstatd (jstatd) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/rmic to provide /usr/bin/rmic (rmic) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/serialver to provide /usr/bin/serialver (serialver) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
Processing triggers for systemd (237-3ubuntu10.42) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …
Processing triggers for ureadahead (0.100.0-21) …
Processing triggers for libc-bin (2.27-3ubuntu1.2) …
From this output I could see that for the JAVA_HOME environment variable, I will be using later on in this article, I had to use the path: /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
Step 2b Optionally get GraalVM 20.1.0 for native compilation
On the “QUARKUS – GET STARTED” page, I clicked on the link “GraalVM” in step 2.
[https://www.graalvm.org/]
From there I clicked on the links “GET STARTED”, followed by “Install GraalVM” and “Linux”.
[https://www.graalvm.org/docs/getting-started/linux#installation-on-linux-platforms]
I wanted to use the java11 variant. As you can see, the graalvm-ce-java11-linux-aarch64-20.1.0, is currently under development and is provided for evaluation and testing use. This was fine by me.
On the “Linux” page, in part “Installation on Linux Platform”, I clicked on the link “GraalVM Releases repository on GitHub”.
[https://github.com/graalvm/graalvm-ce-builds/releases]
Then, I clicked on the link “GraalVM Community Edition 20.1.0”.
[https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-20.1.0]
To download the tar.gz file, I used the following command on the Linux Command Prompt:
cd /tmp
wget https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.1.0/graalvm-ce-java11-linux-amd64-20.1.0.tar.gz
With the following output:
–2020-08-16 15:44:28– https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.1.0/graalvm-ce-java11-linux-amd64-20.1.0.tar.gz
Resolving github.com (github.com)… 140.82.118.3
Connecting to github.com (github.com)|140.82.118.3|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/222889977/7d7c1380-99e7-11ea-8b4c-6129a7f24477?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200816%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200816T154429Z&X-Amz-Expires=300&X-Amz-Signature=616197d68308f4c0f7da55e88451e1ce3e381613d20c328c161f7995863edd0f&X-Amz-SignedHeaders=host&actor_id=0&repo_id=222889977&response-content-disposition=attachment%3B%20filename%3Dgraalvm-ce-java11-linux-amd64-20.1.0.tar.gz&response-content-type=application%2Foctet-stream [following]
–2020-08-16 15:44:36– https://github-production-release-asset-2e65be.s3.amazonaws.com/222889977/7d7c1380-99e7-11ea-8b4c-6129a7f24477?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200816%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200816T154429Z&X-Amz-Expires=300&X-Amz-Signature=616197d68308f4c0f7da55e88451e1ce3e381613d20c328c161f7995863edd0f&X-Amz-SignedHeaders=host&actor_id=0&repo_id=222889977&response-content-disposition=attachment%3B%20filename%3Dgraalvm-ce-java11-linux-amd64-20.1.0.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)… 52.216.111.19
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.111.19|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 442680579 (422M) [application/octet-stream]
Saving to: ‘graalvm-ce-java11-linux-amd64-20.1.0.tar.gz’
graalvm-ce-java11-linux-amd64-20.1.0.tar.g 100%[=======================================================================================>] 422.17M 4.25MB/s in 2m 48s
2020-08-16 15:47:25 (2.51 MB/s) – ‘graalvm-ce-java11-linux-amd64-20.1.0.tar.gz’ saved [442680579/442680579]
To unzip the archive in the /opt directory, I used the following command on the Linux Command Prompt:
sudo tar -xvf graalvm-ce-java11-linux-amd64-20.1.0.tar.gz -C /opt
With the following output:
graalvm-ce-java11-20.1.0/GRAALVM-README.md
graalvm-ce-java11-20.1.0/LICENSE.txt
graalvm-ce-java11-20.1.0/THIRD_PARTY_LICENSE.txt
graalvm-ce-java11-20.1.0/bin/gu
graalvm-ce-java11-20.1.0/bin/jvisualvm
graalvm-ce-java11-20.1.0/include/trufflenfi.h
graalvm-ce-java11-20.1.0/lib/installer/installer.jar
graalvm-ce-java11-20.1.0/lib/installer/components/polyglot/.registry
graalvm-ce-java11-20.1.0/lib/installer/bin/gu
graalvm-ce-java11-20.1.0/lib/visualvm/./platform/
graalvm-ce-java11-20.1.0/lib/visualvm/./etc/
…
graalvm-ce-java11-20.1.0/lib/server/classes.jsa
graalvm-ce-java11-20.1.0/lib/server/libjsig.so
From this output I could see that in order to prepend the GraalVM bin directory to the PATH environment variable, later on in this article, I had to use the path: /opt/graalvm-ce-java11-20.1.0/bin
Next, I used the following command on the Linux Command Prompt:
cd /opt
ls -latr
With the following output:
total 20
drwxr-xr-x 9 root root 4096 Aug 15 17:56 VBoxGuestAdditions-6.0.20
drwx–x–x 4 root root 4096 Aug 15 17:58 containerd
drwxr-xr-x 24 root root 4096 Aug 16 08:22 ..
drwxr-xr-x 5 root root 4096 Aug 16 17:39 .
drwxr-xr-x 10 root root 4096 Aug 16 17:39 graalvm-ce-java11-20.1.0
Remark:
You can also specify GraalVM as the JRE or JDK installation in your Java IDE.
[https://www.graalvm.org/docs/getting-started/linux#installation-on-linux-platforms]
On the “Linux” page, I also had a look at part “Install Additional Components”.
[https://www.graalvm.org/docs/getting-started/linux#install-additional-components]
I knew from reading through some of the guided code examples I wanted to do, I needed to install the native-image tool using gu install.
[https://quarkus.io/guides/building-native-image]
On the “QUARKUS – BUILDING A NATIVE EXECUTABLE” page, I clicked on the link “configured appropriately”.
[https://quarkus.io/guides/building-native-image#configuring-graalvm]
From this and the earlier output I could see that for the GRAALVM_HOME environment variable, I will be using later on in this article, I had to use the path: /opt/graalvm-ce-java11-20.1.0
To install the native-image tool, I used the following command on the Linux Command Prompt:
sudo ./opt/graalvm-ce-java11-20.1.0/bin/gu install native-image
With the following output:
sudo: ./opt/graalvm-ce-java11-20.1.0/bin/gu: command not found
Then I investigated the problem.
Next, I used the following command on the Linux Command Prompt:
cd /opt/graalvm-ce-java11-20.1.0/bin
ls -latr
With the following output:
total 632
-rwxr-xr-x 1 root root 6340 Apr 27 18:49 jvisualvm
-rwxr-xr-x 1 root root 122048 May 15 12:57 unpack200
-rwxr-xr-x 1 root root 13080 May 15 12:57 rmiregistry
-rwxr-xr-x 1 root root 13072 May 15 12:57 rmid
-rwxr-xr-x 1 root root 13072 May 15 12:57 rmic
-rwxr-xr-x 1 root root 13072 May 15 12:57 pack200
-rwxr-xr-x 1 root root 13072 May 15 12:57 keytool
-rwxr-xr-x 1 root root 13072 May 15 12:57 jstat
-rwxr-xr-x 1 root root 13120 May 15 12:57 jstack
-rwxr-xr-x 1 root root 13072 May 15 12:57 jshell
-rwxr-xr-x 1 root root 13072 May 15 12:57 jps
-rwxr-xr-x 1 root root 13072 May 15 12:57 jmod
-rwxr-xr-x 1 root root 13120 May 15 12:57 jmap
-rwxr-xr-x 1 root root 13120 May 15 12:57 jlink
-rwxr-xr-x 1 root root 13120 May 15 12:57 jjs
-rwxr-xr-x 1 root root 13120 May 15 12:57 jinfo
-rwxr-xr-x 1 root root 13072 May 15 12:57 jimage
-rwxr-xr-x 1 root root 13072 May 15 12:57 jhsdb
-rwxr-xr-x 1 root root 13072 May 15 12:57 jfr
-rwxr-xr-x 1 root root 13072 May 15 12:57 jdb
-rwxr-xr-x 1 root root 13072 May 15 12:57 jcmd
-rwxr-xr-x 1 root root 13120 May 15 12:57 javadoc
-rwxr-xr-x 1 root root 13056 May 15 12:57 java
-rwxr-xr-x 1 root root 13072 May 15 12:57 jarsigner
-rwxr-xr-x 1 root root 13072 May 15 12:57 jar
-rwxr-xr-x 1 root root 13072 May 15 12:57 serialver
-rwxr-xr-x 1 root root 13072 May 15 12:57 jstatd
-rwxr-xr-x 1 root root 13128 May 15 12:57 jrunscript
-rwxr-xr-x 1 root root 13072 May 15 12:57 jdeps
-rwxr-xr-x 1 root root 13072 May 15 12:57 jdeprscan
-rwxr-xr-x 1 root root 13128 May 15 12:57 jconsole
-rwxr-xr-x 1 root root 13072 May 15 12:57 javap
-rwxr-xr-x 1 root root 13120 May 15 12:57 javac
lrwxrwxrwx 1 root root 23 May 15 13:00 gu -> ../lib/installer/bin/gu
lrwxrwxrwx 1 root root 28 May 15 13:00 polyglot -> ../lib/polyglot/bin/polyglot
lrwxrwxrwx 1 root root 23 May 15 13:00 npx -> ../languages/js/bin/npx
lrwxrwxrwx 1 root root 23 May 15 13:00 npm -> ../languages/js/bin/npm
lrwxrwxrwx 1 root root 24 May 15 13:00 node -> ../languages/js/bin/node
lrwxrwxrwx 1 root root 25 May 15 13:00 lli -> ../languages/llvm/bin/lli
lrwxrwxrwx 1 root root 22 May 15 13:00 js -> ../languages/js/bin/js
drwxr-xr-x 10 root root 4096 Aug 16 17:39 ..
drwxr-xr-x 2 root root 4096 Aug 16 17:39 .
Next, I used the following command on the Linux Command Prompt:
cd /opt/graalvm-ce-java11-20.1.0/lib/installer/bin
sudo ./gu install native-image
With the following output:
Downloading: Component catalog from www.graalvm.org
Processing Component: Native Image
Downloading: Component native-image: Native Image from github.com
Installing new component: Native Image (org.graalvm.native-image, version 20.1.0)
Step 3 You need Apache Maven 3.6.2+ or Gradle
On the “QUARKUS – GET STARTED” page, I clicked on the link “Apache Maven 3.6.2+” in step 3.
[https://maven.apache.org/]
From there I clicked on the link “Download”.
To download the tar.gz file, I used the following command on the Linux Command Prompt:
cd /tmp
wget http://apache.cs.uu.nl/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
With the following output:
–2020-08-17 06:47:58– http://apache.cs.uu.nl/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
Resolving apache.cs.uu.nl (apache.cs.uu.nl)… 131.211.31.189
Connecting to apache.cs.uu.nl (apache.cs.uu.nl)|131.211.31.189|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 9506321 (9.1M) [application/x-gzip]
Saving to: ‘apache-maven-3.6.3-bin.tar.gz’
apache-maven-3.6.3-bin.tar.gz 100%[=======================================================================================>] 9.07M 1.50MB/s in 7.3s
2020-08-17 06:48:06 (1.25 MB/s) – ‘apache-maven-3.6.3-bin.tar.gz’ saved [9506321/9506321]
On the “Welcome to Apache Maven” page, I clicked on the link “Install”.
[ https://maven.apache.org/install.html]
To unzip the archive in the /opt directory, I used the following command on the Linux Command Prompt:
sudo tar xzvf apache-maven-3.6.3-bin.tar.gz -C /opt
With the following output:
apache-maven-3.6.3/README.txt
apache-maven-3.6.3/LICENSE
apache-maven-3.6.3/NOTICE
apache-maven-3.6.3/lib/
apache-maven-3.6.3/lib/cdi-api.license
apache-maven-3.6.3/lib/commons-cli.license
apache-maven-3.6.3/lib/commons-io.license
apache-maven-3.6.3/lib/commons-lang3.license
apache-maven-3.6.3/lib/guava.license
apache-maven-3.6.3/lib/guice.license
apache-maven-3.6.3/lib/jansi.license
apache-maven-3.6.3/lib/javax.inject.license
apache-maven-3.6.3/lib/jcl-over-slf4j.license
apache-maven-3.6.3/lib/jsoup.license
apache-maven-3.6.3/lib/jsr250-api.license
apache-maven-3.6.3/lib/org.eclipse.sisu.inject.license
apache-maven-3.6.3/lib/org.eclipse.sisu.plexus.license
apache-maven-3.6.3/lib/plexus-cipher.license
apache-maven-3.6.3/lib/plexus-component-annotations.license
apache-maven-3.6.3/lib/plexus-interpolation.license
apache-maven-3.6.3/lib/plexus-sec-dispatcher.license
apache-maven-3.6.3/lib/plexus-utils.license
apache-maven-3.6.3/lib/slf4j-api.license
apache-maven-3.6.3/boot/
apache-maven-3.6.3/boot/plexus-classworlds.license
apache-maven-3.6.3/lib/jansi-native/
apache-maven-3.6.3/lib/jansi-native/freebsd32/
apache-maven-3.6.3/lib/jansi-native/freebsd64/
apache-maven-3.6.3/lib/jansi-native/linux32/
apache-maven-3.6.3/lib/jansi-native/linux64/
apache-maven-3.6.3/lib/jansi-native/osx/
apache-maven-3.6.3/lib/jansi-native/windows32/
apache-maven-3.6.3/lib/jansi-native/windows64/
apache-maven-3.6.3/lib/jansi-native/freebsd32/libjansi.so
apache-maven-3.6.3/lib/jansi-native/freebsd64/libjansi.so
apache-maven-3.6.3/lib/jansi-native/linux32/libjansi.so
apache-maven-3.6.3/lib/jansi-native/linux64/libjansi.so
apache-maven-3.6.3/lib/jansi-native/osx/libjansi.jnilib
apache-maven-3.6.3/lib/jansi-native/windows32/jansi.dll
apache-maven-3.6.3/lib/jansi-native/windows64/jansi.dll
apache-maven-3.6.3/bin/m2.conf
apache-maven-3.6.3/bin/mvn.cmd
apache-maven-3.6.3/bin/mvnDebug.cmd
apache-maven-3.6.3/bin/mvn
apache-maven-3.6.3/bin/mvnDebug
apache-maven-3.6.3/bin/mvnyjp
apache-maven-3.6.3/conf/
apache-maven-3.6.3/conf/logging/
apache-maven-3.6.3/conf/logging/simplelogger.properties
apache-maven-3.6.3/conf/settings.xml
apache-maven-3.6.3/conf/toolchains.xml
apache-maven-3.6.3/lib/ext/
apache-maven-3.6.3/lib/jansi-native/
apache-maven-3.6.3/lib/ext/README.txt
apache-maven-3.6.3/lib/jansi-native/README.txt
apache-maven-3.6.3/boot/plexus-classworlds-2.6.0.jar
apache-maven-3.6.3/lib/maven-embedder-3.6.3.jar
apache-maven-3.6.3/lib/maven-settings-3.6.3.jar
apache-maven-3.6.3/lib/maven-settings-builder-3.6.3.jar
apache-maven-3.6.3/lib/maven-plugin-api-3.6.3.jar
apache-maven-3.6.3/lib/maven-model-3.6.3.jar
apache-maven-3.6.3/lib/maven-model-builder-3.6.3.jar
apache-maven-3.6.3/lib/maven-builder-support-3.6.3.jar
apache-maven-3.6.3/lib/maven-resolver-api-1.4.1.jar
apache-maven-3.6.3/lib/maven-resolver-util-1.4.1.jar
apache-maven-3.6.3/lib/maven-shared-utils-3.2.1.jar
apache-maven-3.6.3/lib/commons-io-2.5.jar
apache-maven-3.6.3/lib/guice-4.2.1-no_aop.jar
apache-maven-3.6.3/lib/guava-25.1-android.jar
apache-maven-3.6.3/lib/javax.inject-1.jar
apache-maven-3.6.3/lib/jsr250-api-1.0.jar
apache-maven-3.6.3/lib/plexus-utils-3.2.1.jar
apache-maven-3.6.3/lib/plexus-sec-dispatcher-1.4.jar
apache-maven-3.6.3/lib/plexus-cipher-1.7.jar
apache-maven-3.6.3/lib/slf4j-api-1.7.29.jar
apache-maven-3.6.3/lib/commons-lang3-3.8.1.jar
apache-maven-3.6.3/lib/maven-core-3.6.3.jar
apache-maven-3.6.3/lib/maven-repository-metadata-3.6.3.jar
apache-maven-3.6.3/lib/maven-artifact-3.6.3.jar
apache-maven-3.6.3/lib/maven-resolver-provider-3.6.3.jar
apache-maven-3.6.3/lib/maven-resolver-impl-1.4.1.jar
apache-maven-3.6.3/lib/maven-resolver-spi-1.4.1.jar
apache-maven-3.6.3/lib/org.eclipse.sisu.inject-0.3.4.jar
apache-maven-3.6.3/lib/plexus-component-annotations-2.1.0.jar
apache-maven-3.6.3/lib/maven-compat-3.6.3.jar
apache-maven-3.6.3/lib/plexus-interpolation-1.25.jar
apache-maven-3.6.3/lib/wagon-provider-api-3.3.4.jar
apache-maven-3.6.3/lib/org.eclipse.sisu.plexus-0.3.4.jar
apache-maven-3.6.3/lib/cdi-api-1.0.jar
apache-maven-3.6.3/lib/commons-cli-1.4.jar
apache-maven-3.6.3/lib/wagon-http-3.3.4-shaded.jar
apache-maven-3.6.3/lib/jsoup-1.12.1.jar
apache-maven-3.6.3/lib/jcl-over-slf4j-1.7.29.jar
apache-maven-3.6.3/lib/wagon-file-3.3.4.jar
apache-maven-3.6.3/lib/maven-resolver-connector-basic-1.4.1.jar
apache-maven-3.6.3/lib/maven-resolver-transport-wagon-1.4.1.jar
apache-maven-3.6.3/lib/maven-slf4j-provider-3.6.3.jar
apache-maven-3.6.3/lib/jansi-1.17.1.jar
In order to prepend the Maven bin directory to the PATH environment variable, later on in this article, I had to use the path: /opt/apache-maven-3.6.3/bin
Next, I used the following command on the Linux Command Prompt:
cd /opt
ls -latr
With the following output:
total 24
drwxr-xr-x 9 root root 4096 Aug 15 17:56 VBoxGuestAdditions-6.0.20
drwx–x–x 4 root root 4096 Aug 15 17:58 containerd
drwxr-xr-x 24 root root 4096 Aug 16 08:22 ..
drwxr-xr-x 10 root root 4096 Aug 16 17:39 graalvm-ce-java11-20.1.0
drwxr-xr-x 6 root root 4096 Aug 17 06:49 .
drwxr-xr-x 6 root root 4096 Aug 17 06:49 apache-maven-3.6.3
Step 4 Start Coding with Quarkus 1.7.0.Final
On the “QUARKUS – GET STARTED” page, I clicked on the link “Start Coding” in step 4.
[https://www.graalvm.org/]
So apparently the “get started” steps were al done and I could now start coding with Quarkus.
You can read more about the code guides I tried out in my next article.
But, I still had to set some environment variables in order for my demo environment to work properly.
Permanently setting environment variables for all users
A suitable file for environment variable settings that affect the system as a whole (rather than just a particular user) is /etc/environment. An alternative is to create a file for the purpose in the /etc/profile.d directory.
Files with the .sh extension in the /etc/profile.d directory get executed whenever a bash login shell is entered (e.g. when logging in from the console or over ssh), as well as by the DisplayManager when the desktop session loads.
[https://help.ubuntu.com/community/EnvironmentVariables]
In order to check the content of the /etc/environment file, I used the following command on the Linux Command Prompt:
cat /etc/environment
With the following output:
PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games”
In order to check the content of the /etc/profile.d directory, I used the following command on the Linux Command Prompt:
cd /etc/profile.d
ls -latr
With the following output:
total 36
-rw-r–r– 1 root root 1003 Dec 29 2015 cedilla-portuguese.sh
-rw-r–r– 1 root root 1557 Dec 4 2017 Z97-byobu.sh
-rw-r–r– 1 root root 664 Apr 2 2018 bash_completion.sh
-rw-r–r– 1 root root 96 Sep 27 2019 01-locale-fix.sh
-rwxr-xr-x 1 root root 873 Jun 3 02:08 Z99-cloudinit-warnings.sh
-rwxr-xr-x 1 root root 3417 Jun 3 02:08 Z99-cloud-locale-test.sh
-rw-r–r– 1 root root 825 Jul 10 14:00 apps-bin-path.sh
drwxr-xr-x 2 root root 4096 Aug 12 15:55 .
drwxr-xr-x 95 root root 4096 Aug 17 14:26 ..
In order to set some environment variables permanently, I used the following command on the Linux Command Prompt in order to create and edit the file myenvvars.sh:
sudo vim myenvvars.sh
And I changed the content to:
export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
export PATH=$JAVA_HOME/bin:$PATH
export GRAALVM_HOME=/opt/graalvm-ce-java11-20.1.0
export PATH=${GRAALVM_HOME}/bin:$PATH
export PATH=/opt/apache-maven-3.6.3/bin:$PATH
Next, I used vagrant ssh to connect into the running VM and checked if the environment variables were set correctly.
In order to check the Java version, I used the following command on the Linux Command Prompt:
java --version
With the following output:
openjdk 11.0.7 2020-04-14
OpenJDK Runtime Environment GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02)
OpenJDK 64-Bit Server VM GraalVM CE 20.1.0 (build 11.0.7+10-jvmci-20.1-b02, mixed mode, sharing)
In order to check the Maven version, I used the following command on the Linux Command Prompt:
mvn -v
With the following output:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/apache-maven-3.6.3
Java version: 11.0.8, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64
Default locale: en, platform encoding: UTF-8
OS name: “linux”, version: “4.15.0-112-generic”, arch: “amd64”, family: “unix”
With these final checks I conclude this article. I shared with you the steps I took to set up a demo environment, so I could get started with Quarkus. In a next article, you can read more about the code guides I tried out.
Like this:
Like Loading...
We gain a firm knowledge and understanding of the Java Traning by this blog. I look forward to more updates and will be returning. Thank you for sharing.