How to Install Oracle Glassfish Application Server on Windows

  1. Download executable jar from here.
  2. Put the downloaded file in C drive or anywhere you like
  3. Open command prompt ( Start > Run > write cmd and press OK)
  4. On command prompt go to C drive
  5. Run the following commandjava –Xms256m –jar glassfish-installer-v2ur2-b04-windows.jar
  6. You will see this screen
  7. Scroll down the page and Accept button will be enabled ( You can’t force me to read it :P)
  8. Installation starts and you see lots of garbage on command prompt screen 😛
  9. Installation done? Nops, just a few more steps
  10. Now you will have a directory C:\glassfish
  11. We must activate setup.xml in glassfish directory. For that, open command prompt and go to C:\glassfish.
  12. Run this command
    ant –f setup.xml
  13. 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.
  14. 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
  15. Now back to the Glassfish installation. Run this command again
    ant –f setup.xml
  16. If windows firewall popup appears, unblock it.
  17. If the installation is successful you will get a Build Successful message.
  18. Hurray! we have done it.
  19. Now lets check if glassfish is properly installed or not.
  20. 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
    [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.
  21. I hope now every problem is solved.
  22. Open your browser and hit the following URL
    http://localhost:8081/You will see a success message on the web page.

One Response to “How to Install Oracle Glassfish Application Server on Windows”

  1. 1 tatiana

    Excelente…!!! Gracias por tu ayuda….

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: