///////////////////////////////////////////////////////////////////////////////

    Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

///////////////////////////////////////////////////////////////////////////////

= Prerequisites
:description: Helidon pre-requisites
:keywords: helidon

Everything you need to use Helidon is listed here.

== Prerequisites

Helidon requires Java 8 (or greater) and Maven. You need Docker if you
want to build and deploy Docker containers. If you want to
deploy to Kubernetes, you need `kubectl` and a Kubernetes cluster (you can
<<getting-started/04_kubernetes.adoc,install one on your desktop>>). 

The following list shows the minimum versions.

//[role="flex, sm7, md6, lg5"]
[role="flex, sm7"]
|=======
|https://www.oracle.com/technetwork/java/javase/downloads[Java{nbsp}SE{nbsp}8] or http://jdk.java.net[Open{nbsp}JDK{nbsp}8] | {nbsp}
|https://maven.apache.org/download.cgi[Maven 3.5] | {nbsp}
|https://docs.docker.com/install/[Docker 18.02] | Use the Edge channel to run Kubernetes on your desktop
|https://kubernetes.io/docs/tasks/tools/install-kubectl/[Kubectl 1.7.4] | {nbsp}
|=======


[source,bash]
.Verify Prerequisites
----
java --version
mvn --version
docker --version
kubectl version --short
----

== Setting JAVA_HOME

[source,bash]
.Setting JAVA_HOME
----
# On Mac
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

# On Linux
# Use the appropriate path to your JDK
export JAVA_HOME=/usr/lib/jvm/jdk-8
----

/////////////////////////////////////////////////////////////////////////////
Since we are using docker build, these don't need to be set
== Setting MAVEN_OPTS

The base example used throughout the documentation supports building docker images
using Maven. In order for this to work with Java 9 you must set some options.
Note that these options only work with Java 9. If you do not plan on generating a docker
image then you can skip this section.

[source,bash]
.Setting `MAVEN_OPTS`
----
export MAVEN_OPTS="--add-modules java.xml.bind \
    --add-opens java.base/java.lang=ALL-UNNAMED \
    --add-opens java.xml.bind/javax.xml.bind=ALL-UNNAMED \
    --add-opens java.activation/javax.activation=ALL-UNNAMED \
    -Xmx1024M"
----
/////////////////////////////////////////////////////////////////////////////

== Try the Quickstart Examples

Now you are ready to try the
<<getting-started/02_base-example.adoc#Prerequisites,Quickstart Examples>>.
