Jul 19, 2017

How to solve java: not found problem with Glassfish

If you get an error when starting Glassfish similar to this:
[[email protected]]# service glassfish3 start
Starting Glassfish Service java
glassfish/bin/asadmin: line 54: exec: java: not found

You need to re-configure your Java path in your Glassfissh configuration file:

Open glassfish/config/asenv.conf in your editor of choice and add path similar to the following line:

AS_JAVA="/usr/java/jdk1.8.0"

Save the file and Glassfish service should start without problems.

You can find your Java path by:

which java