I\'ve got GlassFish 2.1.1 installed. I have a 1.5 and a 1.6 JDK installed. Even though my JAVA_HOME variable is set to the 1.5 version (and both \"java -version\" and \"java
In Linux file system , Edit below file as this steps
Path - /opt/glassfish3/glassfish/config
File Name - asenv.conf
Add the JAVA HOME path as below to the end of file.
AS_JAVA=/opt/jdk1.8.0_201
Now start the glassfish server.