GlassFish Server Cannot Be Installed As Root User and Reports the Error "Existing installation has been detected in this directory" (Doc ID 1349867.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle GlassFish Server - Version 8.1 to 9.1 [Release 8.1 to 9.1]
Oracle GlassFish Server - Version 2.1.1 and later
Oracle Solaris on SPARC (32-bit)
Oracle Solaris on SPARC (64-bit)
Oracle Solaris on x86 (32-bit)
Oracle Solaris on x86-64 (64-bit)

Symptoms

The GlassFish Server installer fails to install on a machine which had a prior installation of the SunOne Java Enterprise Server (JES) or GlassFish Server, which has been removed or uninstalled, and the new installation is using the same installation location.  A warning message may be reported during the GlassFish installation:

Existing installation has been detected in this directory.

Please select another directory or uninstall existing installation before
proceeding


The error indicates that the installer believes the previous GlassFish installation still exists, even if the installation folder/directory no longer exists. This results in the new installation of GlassFish 2.x into this particular installation path failing. 

If the above scenario does not apply to your system, it is possible that the installation may still succeed but at the end of the installation, an error like the one below can be seen:

ERROR - node agent creation returned following exception: abnormal subprocess
termination: Detailed Message:/opt/SUNWappserver/bin/asadmin:
<GF 9.1 installation>/jdk/bin/java: not found
<GF 9.1 installation>/bin/asadmin: <GF 9.1 installation>/jdk/bin/java: not found
INFO - End core server configuration.
INFO - Start samples configuration.
INFO - End samples configuration.
INFO - Start Java DB Configuration.
INFO - End Java DB Configuration.
INFO - Start samples configuration.
WARNING - Error while creating samples list.html file
INFO - End samples configuration.
INFO - Start HADB Installation.
INFO - End HADB Installation.


On trying to start the instance using asadmin, error like the one shown below is seen suggesting that  the installation is incomplete:

# ./asadmin: /<GF 9.1 installation>/root/jdk/bin/java: can not found

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms