Specify which JVM GlassFish should use
By alexismp on Jul 19, 2011
With new releases of the JDK (updates to Java 6 or better yet, Java 7, more on that later) you may be tempted to upgrade the JVM used by GlassFish without changing your user or system settings.
Byron has a blog for you on How GlassFish picks up Java.
His post covers starting GlassFish with the
asadmin CLI and the order in which the appserver will consider JDK installations. My favorite way to specify a given JDK is the use of
glassfish/config/asenv.conf (your mileage may vary). Check out the other possibilities.
Byron even has the links to the source code so that you can study the actual implementation (and who knows maybe improve it).