By Ahmed Qureshi
This is Part 1 of our GlassFish – Back to Basics series.
Installing GlassFish / Payara Server 4.1
1. Make sure the appropriate JDK is installed:
Java EE 7 requires JDK 7 or above to be installed beforehand as it uses some of the latest features; the current recommended version is JDK 8u20. To check what version you have, in a shell/command window simply type:
If the java command is not recognised then you will have to install the JDK which can be downloaded from here: http://java.sun.com/javase/downloads/index.jsp
2. Set the JAVA_HOME variable to the JDK location:
An easy tip to determine the location of where your JDK (one or multiple versions) is installed is to enter the following command into your shell box:
sudo update-alternatives --config java
Set your JAVA_HOME variable as follows:
(in the example above: /usr/lib/jvm/java-8-oracle)
To persist the variable across sessions, simply add the export to the current user’s
.bash_rc file. This is a hidden file in the user’s home directory;
3. Downloading GlassFish/Payara
GlassFish can be downloaded from: https://glassfish.java.net/download.html
Payara can be downloaded from: http://www.payara.co.uk/downloads
Download to a directory of your choosing and then unzip.
Running GlassFish / Payara Server 4.1
In the case of GlassFish to run the server, change directory to install_directory/glassfish/bin and enter the following command:
Similarly for Payara as shown below:
This will start domain1, which is the default domain included with GlassFish. If you were to create a new domain, that would need to be specified explicitly – like with Payara’s payaradomain. To maintain compatibility with GlassFish, though, domain1 is preferred if no domain is specified, rather than throwing an error from version 4.1.153 and up.
Accessing the Administration Console
Once the server is up running, navigate to http://localhost:4848 to access the console. Your page should look something like this:
More GlassFish Back to Basics is coming soon so watch this space!