How to Install Oracle Glassfish Application Server on Windows
29Jul11
- Download executable jar from here.
- Put the downloaded file in C drive or anywhere you like
- Open command prompt ( Start > Run > write cmd and press OK)
- On command prompt go to C drive
- Run the following commandjava –Xms256m –jar glassfish-installer-v2ur2-b04-windows.jar
- You will see this screen

- Scroll down the page and Accept button will be enabled ( You can’t force me to read it
) - Installation starts and you see lots of garbage on command prompt screen
- Installation done? Nops, just a few more steps
- Now you will have a directory C:\glassfish
- We must activate setup.xml in glassfish directory. For that, open command prompt and go to C:\glassfish.
- Run this command
ant –f setup.xml - Ouch! I got an error. Apache Ant is not installed on my system.’ant’ is not recognized as an internal or external command,
operable program or batch file. - Lets first install Ant.
Fortunately, we already have ant with us in the glassfish directory under glassfish/lib/ant directory. Now we are gonna set ANT_HOME and PATH variables for ANT.a. Right click My Computer and choose “properties” then click on “Advanced” tab and press “Environment Variables” button.
b. In “System Variables” click “New” button and enter ANT_HOME as Variable name and C:\glassfish\lib\ant as Variable value.
c. In the System Variables, find “Path” variable and click Edit. Put this at the end of the variable value ;%ANT_HOEM%\bin.To verify the installation, open a new command prompt and run this command
ant –version
Ant version number will be printed on the console
Apache Ant version 1.6.5 compiled on June 2 2005 - Now back to the Glassfish installation. Run this command again
ant –f setup.xml - If windows firewall popup appears, unblock it.
- If the installation is successful you will get a Build Successful message.
- Hurray! we have done it.
- Now lets check if glassfish is properly installed or not.
- Go to C:\glassfish\bin and run the following command
asadmin start-domain domain1
But I got an error her
C:\glassfish\domains is not a directory
CLI156 Could not start the domain domain1.If you look to the end of previous command output, you will see this
create.domain:
[exec] Port 8080 is in use.
[exec] CLI130 Could not create domain, domain1
[delete] Deleting: C:\glassfish\passfile
So obvious, port 8080 is in use. If you know what program is using it, close it or change the port in C:/glassfish/setup.xml file. Search 8080 in file and put anything else like 8081. Save the file and do step 15 on wards again. - I hope now every problem is solved.
- Open your browser and hit the following URL
http://localhost:8081/You will see a success message on the web page.
Filed under: Glassfish, Programming, Tutorials, Web/Application Server, Windows | Leave a Comment
Tags: application server, glassfish, Installations, java, web server




No Responses Yet to “How to Install Oracle Glassfish Application Server on Windows”