...
sudo apt-get update
udo apt-get install python-software-properties
In order to use add-apt-repository, you need to install python-software-properties
udo add-apt-repository ppa:webupd8team/java
This failed, I had to add the following "apt-get software-properties-common" so that the above command is available
sudo apt-get update
This will ensure the new repo is available to apt-get
sudo apt-get install oracle-java7java8-installer
This will install the java jdk
java -version
Do this to confirm the java version
wget download.java.net/glassfish/4.1.2/release/glassfish-4.1.2.zip
This will download glassfish, after which we will need to extract it
unzip glassfish-4.1.2.zip
If unzip is not available, use "apt-get install unzip" to install it on the machine
unzip glassfish-4.1.2.zip -d /opt
Will extract glassfish to /opt
asadmin start-domain
This should start glassfish and you should see something like
Waiting for domain1 to start ................... Successfully started the domain : domain1 domain Location: /opt/glassfish4/glassfish/domains/domain1 Log File: /opt/glassfish4/glassfish/domains/domain1/logs/server.log Admin Port: 4848 Command start-domain executed successfully.
asadmin enable-secure-admin
You should see something like
Enter admin user name> admin Enter admin password for user "admin"> You must restart all running servers for the change in secure admin to take effect. Command enable-secure-admin executed successfully.
asadmin restart-domain
This will restart the domain so the security constraints take affect
Successfully restarted the domain Command restart-domain executed successfully.
...