• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Cannot set up glassfish on mac

 
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have read the manuals and guides but still can't get glassfish to set up on my machine.
I downloaded the latest version of glassfish in zip format.
I unzipped this using the terminal so i have my glassfish3 folder.
When i navigate to this folder in terminal glassfish3/bin i enter the command start-domain.
This keeps returning an error asadmin: command not found
If i look in the bin folder i have the asadmin file but it wont execute when i navigate to it this way.
Any ideas?
Thanks
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't use glassfish, but it sounds like the bin folder may not have been added to the PATH environment variable. (Though if it's in the current directory, I'd expect that it'd pick it up anyways.)
 
tom davies
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How would i do this, to check if that is the problem?
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In your ~ folder you should have a .bash_profile or a .bashrc file. If not, you can create one.

In the file you can add the folder to the definition of the PATH variable. (Be sure to leave ":." at the end if it's already there).
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the file you should have a statement like the following (this is from mine -- it's a single line, wrapped here for readability).


Add the folder to this list, delimited by :.

Again, be sure to leave ":." as the trailing entry.

If this doesn't help your original issue, at least you'll have learned how to add a folder to PATH.
 
tom davies
Ranch Hand
Posts: 168
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You posted that reply when i was in the middle of mine.
I dont think i have a bash file
Could you give me a step by step of how to create one, where to put it and what to include etc? Not really sure what i should be doing.
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No probs. Do this:

  • Open a Terminal window (or get iTerm, which I prefer)
  • Do pwd. Make sure that you are "in" your home folder. That's the default so you should be. To make absolutely sure you can enter cd ~
  • Do ls -al
  • Check the results to see if you have a .bashrc or .bash_profile file in that folder. The leading dot make the files hidden, so they won't show up in Finder.

  • Post back with whether you have such a file or not.
     
    tom davies
    Ranch Hand
    Posts: 168
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks a lot.
    That is what i did to check previously.
    I only have .bash_history but not the files you mentioned
     
    Bear Bibeault
    Sheriff
    Posts: 67750
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    So you have no PATH already defined? I forget if there's a default one.

    Does echo $PATH display anything?
     
    tom davies
    Ranch Hand
    Posts: 168
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    That displays this.
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
     
    Bear Bibeault
    Sheriff
    Posts: 67750
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    OK, so here goes:

  • Enter touch .bash_profile (this will create the empty file)
  • Open the file with the text editor of your choice
  • Add: export PATH=$PATH:desired-list-folders:. (replacing desired-list-of-folders with a colon delimited list of folders you want on the PATH)

  • Close an reopen the Terminal window (or enter source ~/.bash_profile)
    Type echo $PATH and make sure it's correct.

    Now when you type a command, all folders in PATH will be checked for the command file.
     
    Bear Bibeault
    Sheriff
    Posts: 67750
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    When all is said and done, I believe that the lack of the trailing . on PATH may be what caused the "not found" error. Nothing was set up to cause the current folder to be searched as part of the PATH.

    I'd be surprised if this doesn't solve the issue (but stranger things have happened).
     
    tom davies
    Ranch Hand
    Posts: 168
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Just to clarify would this be what i am looking for to put into the file?
    export PATH=$PATH:usr/documents/glassfish3/bin:.
     
    Bear Bibeault
    Sheriff
    Posts: 67750
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Likes 1
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    tom davies wrote:Just to clarify would this be what i am looking for to put into the file?
    export PATH=$PATH:usr/documents/glassfish3/bin:.



    Close: export PATH=$PATH:/usr/documents/glassfish3/bin:.

    (absolute paths begin with /)

    But if you were always going to cd into the bin folder, you could get away with just export PATH=$PATH:.

    Adding the glassfish folder should allow to issue the commands without having to cd.
     
    tom davies
    Ranch Hand
    Posts: 168
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you. Well that has worked now. i can now input the commands i want BUT, and there had to be a but didn't there. I am now getting another error.
    asadmin> asadmin start-domain
    Remote server does not listen for requests on [localhost:4848]. Is the server up?
    No such local command, asadmin. To run remote commands, start the application server (e.g. 'asadmin start-domain').
    Command asadmin failed.

    I will have a search and see what problem this could be.
     
    Bear Bibeault
    Sheriff
    Posts: 67750
    173
    Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Yeah, now you're in Glassfish territory and I'm useless!

    But glad to help you to this point. (And now you know about PATH and the bash shell's init file!)
     
    tom davies
    Ranch Hand
    Posts: 168
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Does anyone have any ideas about this? Really need it working asap but still have the same problem. I read somewhere that i should check my hostname resolves to an IP address? I can navigate to my etc/hosts file i just dont know what i am looking for, or what to change.
     
    Bartender
    Posts: 3648
    16
    Android Mac OS X Firefox Browser Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hello you should able to cd to the bin directory and type
    "./asadmin start-domain"

    Make sure there is a ./ (dot + slash) in front to indicate it's the current directory.

    To stop it
    "./asadmin stop-domain"

    Oh there are in fact 2 bin directories. Say you have it installed in glassfish3 dir. The first one is in glassfish3/bin and the other one in glassfish3/glassfish/bin. Using either of these are fine.

    Hope this helps.
     
    tom davies
    Ranch Hand
    Posts: 168
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I dont know how but its fixed itself. I had a mess around with the etc/hosts file and before where it used to say my-imac it now says My-iMac in capitals . . .
    I dont know if that is related to anything i did or the fact it now works but it works for now, lets hope when i restart it, it stays the same ha.
    Thanks for the help and the lessons on PATH ;) i will be back if i have any more trouble
     
    And will you succeed? Yes you will indeed! (98 and 3/4 % guaranteed) - Seuss. tiny ad:
    We need your help - Coderanch server fundraiser
    https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
    reply
      Bookmark Topic Watch Topic
    • New Topic