Skip to main content

GlassFish requires DISPLAY to install on Linux server and I only have command line

6 replies [Last post]
redhat19
Offline
Joined: 2012-01-31
Points: 0

Hi,

I am kind of new to Linux and I currently have to manage a dedicated server running RHE 5, generally using a Webmin interface.

I installed Java JDK on the server and tried to install Glassfish (Application server) using the command line by got the following error message: 'This program requires DISPLAY environment variable to be set. Please re-run after assigning an appropriate value to DISPLAY."

I don't have a display/GUI like KDE or Gnome to work with here, only the command line and the Webmin web interface. How can I get Glassfish installed?

I have just unpacking the compressed installation file. Is this good enough for an install?

How can I start the GlassFish server automatically?

Thanks..

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tmueller
Offline
Joined: 2005-10-31
Points: 0

If you download the "glassfish.zip" file, you can just use unzip to
install it. No need to use an installer.

To start GlassFish server automatically, see the "asadmin
create-service" command:

http://docs.oracle.com/cd/E18930_01/html/821-2433/create-service-1.html#...

Tom

redhat19
Offline
Joined: 2012-01-31
Points: 0

Thanks tmueller,

I followed your advise and downloaded a zip version of GlassFish and unzipped it to usr/glassfish3 on server.

Thanks.

I am having problems starting it though as it claims the port is in use by another application, which is untrue.

tmueller
Offline
Joined: 2005-10-31
Points: 0

When GlassFish checks to see if a port is in use, it tries to bind to
the port as a client as well as a server. On some systems, we've seen
firewall software of some sort allow a client to bind to a port even
though there really isn't anything listening on that port. If that
happens you get this behavior.

redhat19
Offline
Joined: 2012-01-31
Points: 0

Thanks tmueller,

I'm trying to understand you properly.. You mean if a firewall allows a client (GlassFish in this instance) to bind to a port even though there really isn't anything listening on that port (GlassFish should be listening on port 4848, right?). Then we get this behaviour?

If this is the case, then if we get the firewall not to allow a client bind to that port when there really isn't anything listening on that port, then this problem will be resolved. right?

Kind regards,

tmueller
Offline
Joined: 2005-10-31
Points: 0

You might want to look at this thread:
http://www.java.net/node/699428

In reply to your question, yes.

redhat19
Offline
Joined: 2012-01-31
Points: 0

Thanks so much, @tmueller.

I was able to solve the problem following the explanation given by @glassfish123 on the page you referred me to: "Ok! I was able to resolve this problem. This problem seems to occur if you have two interfaces, and the hostname returned by the command `hostname` is being used for the ip address for second interface (eth1) in the /etc/hosts file. I moved the name to the ipaddress on eth0 (first entry in /etc/hosts) and the problem went away." I just replaced localdomain.localhost in the first line with my domain and when I started GlassFish, it started.

Thanks!