1 Reply Latest reply: Aug 31, 2013 3:33 PM by Peter.Lorenzen RSS

    Problem with Managed Server pointing to a different JDK

    998899-Oracle

      Hi,

       

      My Adminserver is pointing to JDK 1.7 which is shown in the startup, but my managed servers are pointing to a different 1.6_43 . We are running into Java version mismatch problem while deploying our application built with jdk 1.7 onto these managed servers . How do i change the version of my managed server ?

       

      Thanks

      Sam

        • 1. Re: Problem with Managed Server pointing to a different JDK
          Peter.Lorenzen

          Hi Sam,

           

          You generally only have to change it in two places.

           

          DOMAIN_HOME/bin/setDomainEnv.sh and MW_HOME/wlserver_12.1/common/bin/commEnv.sh

           

          See examples below.

           

          If you are on Linux you can quickly fix it. For example:

          cd /u01/app/oracle/product/fmw
          find . -type f -exec sed -i "s/\/u01\/app\/oracle\/product\/jdk1.6.0_39/\/u01\/app\/oracle\/product\/java_current/g" {} \;
          
          
          
          

           

          It is a good idea to make a softlink to your Java installation, then you will not have this problem in the future. If you are on Windows you can use a symlink.

           

          Linux example:

          ln -s /u01/app/oracle/product/jdk1.7.0_25 /u01/app/oracle/product/java_current
          
          
          
          

           

          Windows example:

          mklink /d D:\oracle\product\java_current D:\oracle\product\jrockit-jdk1.6.0_26-R28.1.4-4.0.1
          
          
          
          

           

          setDomainEnv.sh

          /u01/app/oracle/domains/eksudv/bin/setDomainEnv.sh
          
          if [ "${JAVA_VENDOR}" = "Oracle" ] ; then
                  JAVA_HOME="${BEA_JAVA_HOME}"
                  export JAVA_HOME
          else
                  if [ "${JAVA_VENDOR}" = "Sun" ] ; then
                          JAVA_HOME="${SUN_JAVA_HOME}"
                          export JAVA_HOME
                  else
                          JAVA_VENDOR="Sun"
                          export JAVA_VENDOR
                          JAVA_HOME="/u01/app/oracle/product/java_current"
                          export JAVA_HOME
                  fi
          fi
          
          
          
          

           

          commEnv.sh

          /u01/app/oracle/product/fmw/wlserver_12.1/common/bin/commEnv.sh
          
          # Reset JAVA_HOME, JAVA_VENDOR and PRODUCTION_MODE unless JAVA_HOME
          # and JAVA_VENDOR are pre-defined.
          if [ -z "${JAVA_HOME}" -o -z "${JAVA_VENDOR}" ]; then
            # Set up JAVA HOME
            JAVA_HOME="/u01/app/oracle/product/java_current"
            # Set up JAVA VENDOR, possible values are
            #Oracle, HP, IBM, Sun ...
            JAVA_VENDOR=Sun
            # PRODUCTION_MODE, default to the development mode
            PRODUCTION_MODE=""
          fi
          
          
          
          

           

          Regards Peter

          http://theheat.dk