# Basic Setup
# Download JDK 11
Start by downloading the JDK 11 into the your preferred directory using the this link (opens new window)
open the terminal in your download folder and and change to your download folder
Extract the
tar.gzfile to/usr/java/directory using the command:sudo tar xvzf jdk-11.0ee.7_linux-x64_bin.tar.gz -C /usr/java/Note: the version of the JDK as you will require this setting the environment varibles.
# Download Maven
Check on the latest maven version here here (opens new window)
Start by downloading the Apache Maven into the
/tmpdirectory using the following wget command:wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmpWhen the download is completed, extract the archive in the
/optdirectory:sudo tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
To have more control over Maven versions and updates, we will
create a symbolic linkmaven that will point to the Maven installation directory:sudo ln -s /opt/apache-maven-3.6.3 /opt/mavenTo upgrade your Maven installation, simply unpack the newer version and change the symlink to point to it.
# Setup environment variables
Next, we'll need to set up the environment variables.
Open your text editor and create a new file named
mavenenv.shinside of the/etc/profile.d/directory.sudo nano /etc/profile.d/maven.shPaste the following lines:
export JAVA_HOME=/usr/java/jdk-11.0.7/ export M2_HOME=/opt/maven export MAVEN_HOME=/opt/maven export PATH=${JAVA_HOME}/bin:${PATH} export PATH=${M2_HOME}/bin:${PATH}
Save and close the file. This script will be sourced at shell startup.
Make the script executable by running the following
chmodcommand:sudo chmod +x /etc/profile.d/maven.shLoad the environment variables using the
sourcecommand:source /etc/profile.d/maven.sh
# Verify the installation
To verify that Maven is installed, use the
mvn -versioncommand which will print the Maven version:mvn -versionTo verify that Java is installed, use the
java -versioncommand which will print the java version:java -versionYou should see something like the following:
# Getting Maven dependencies used in Xe
Download the maven zip from the link (opens new window). This will put it in the folder specified but its hidden so to list in the terminal use
ls -aor navigate to the download folder(in linux) file explorer tapctrl + Hto show hidden files.Open your terminal and backup the existing
.m2folder by renaming it to a different name using the command:mv ~/.m2/ ~/.m2backupThis will move the existing
.m2folder into a new folder named by.m2backupNext, switch to the downloaded maven location and extract it to the home folder using the command:
unzip .m2.zip -d ~/The segment after the
-dspecifies, extract to the/home/username/directory.
# Wildfly Configuration
You can setup wildfly as show below or get the already configured from here (opens new window)
Open
wildfly-18.0. 0.Final/standalone/configuration/standalone.xmlin the drivers section of datasources
And within the<datasources></datasources>tag add datasource for oracle
supplyingusernameandpasswordfor the same<datasource jndi-name="java:jboss/datasources/XeDS" pool-name="XeDS" enabled="true" > <connection-url>jdbc:oracle:thin:@//host:port/service_name</connection-url> <driver>com.oracle</driver> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <pool> <min-pool-size>10</min-pool-size> <max-pool-size>100</max-pool-size> <prefill>true</prefill> </pool> <security> <user-name>username</user-name> <password>password</password> </security> <validation> <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker" /> <check-valid-connection-sql>select 1</check-valid-connection-sql> <background-validation>true</background-validation> <background-validation-millis>15000</background-validation-millis> <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker" /> <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter" /> </validation> <statement> <prepared-statement-cache-size>32</prepared-statement-cache-size> <share-prepared-statements>true</share-prepared-statements> </statement> </datasource>
Create user by running
add-user.shfor administration in thebindirectory.