Wednesday, July 14, 2010

Setting up Glassfish on Ubuntu Linux

from this site:

java -version // Check java version. It must be either Java 1.5 or Java 1.6. If not install Java by typing sudo apt-get install sun-java6-jdk. It asks your password, after you enter it, it will install Java 6.
wget http://java.net/download/javaee5/v2ur2/promoted/Linux/glassfish-installer-v2ur2-b04-linux.jar // get the link of latest glassfish server jar for linux from https://glassfish.dev.java.net/public/downloadsindex.html
java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar // Click Accept in the license window that opens
cd glassfish
sudo chmod -R +x lib/ant/bin // Enter password
lib/ant/bin/ant -f setup.xml //Run ant script
cd bin //Go to the directory (usually bin) where asadmin command is available. You can find this by simple ls command or through GUI file xplorer
./asadmin //Run asadmin
asadmin> start-database
asadmin> start-domain domain1
Type http://localhost:4848/ in browser and login as username: admin and password: adminadmin
asadmin> exit // To shutdown the server, type this in the terminal window