Search code examples
javaglassfish

How do I specify the JDK for a GlassFish domain?


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 "javac -version" display 1.5), whenever I start my glassfish domain it always states at the top of the log that its using version 1.6. How can I override this?

Starting Domain domain2, please wait.
04-May-2012 08:38:47 com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
C:/Dev/jdk/1.6/1.6.0_19\bin\java

Solution

  • Here you can find how to set path to JDK for Glassfish: http://www.devdaily.com/blog/post/java/fixing-glassfish-jdk-path-problem-solved

    Check

    glassfish\config\asenv.bat
    

    where java path is configured

    REM set AS_JAVA=C:\Program Files\Java\jdk1.6.0_04\jre/..
    set AS_JAVA=C:\Program Files\Java\jdk1.5.0_16