Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-4387

CLONE - standalone.bat doesn't modify JAVA_OPTS correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.1.2.Final (EAP)
    • 7.1.1.Final
    • Scripts
    • None

      standalone.bat doesn't modify JAVA_OPTS correctly because Only last change of JAVA_OPTS is reflected. JAVA_OPTS isn't dynamically changed withing 'if' part.

      if not "%PRESERVE_JAVA_OPTS%" == "true" (
        rem Add -client to the JVM options, if supported (32 bit VM), and not overriden
        echo "%JAVA_OPTS%" | findstr /I \-server > nul
        if errorlevel == 1 (
          "%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul
          if not errorlevel == 1 (
            set "JAVA_OPTS=-client %JAVA_OPTS%"
          )
        )
      
        rem Add compressed oops, if supported (64 bit VM), and not overriden
        echo "%JAVA_OPTS%" | findstr /I "\-XX:\-UseCompressedOops \-client" > nul
        if errorlevel == 1 (
          "%JAVA%" -XX:+UseCompressedOops -version > nul 2>&1
          if not errorlevel == 1 (
            set "JAVA_OPTS=-XX:+UseCompressedOops %JAVA_OPTS%"
          )
        )
      
        rem Add tiered compilation, if supported (64 bit VM), and not overriden
        echo "%JAVA_OPTS%" | findstr /I "\-XX:\-TieredCompilation \-client" > nul
        if errorlevel == 1 (
          "%JAVA%" -XX:+TieredCompilation -version > nul 2>&1
          if not errorlevel == 1 (
            set "JAVA_OPTS=-XX:+TieredCompilation %JAVA_OPTS%"
          )
        )
      )
      

      must be changed to

      if not "%PRESERVE_JAVA_OPTS%" == "true" (
        rem Add -client to the JVM options, if supported (32 bit VM), and not overriden
        echo "%JAVA_OPTS%" | findstr /I \-server > nul
        if errorlevel == 1 (
          "%JAVA%" -client -version 2>&1 | findstr /I /C:"Client VM" > nul
          if not errorlevel == 1 (
            set "JAVA_OPTS=-client %JAVA_OPTS%"
          )
        )
      )
      
      if not "%PRESERVE_JAVA_OPTS%" == "true" (
        rem Add compressed oops, if supported (64 bit VM), and not overriden
        echo "%JAVA_OPTS%" | findstr /I "\-XX:\-UseCompressedOops \-client" > nul
        if errorlevel == 1 (
          "%JAVA%" -XX:+UseCompressedOops -version > nul 2>&1
          if not errorlevel == 1 (
            set "JAVA_OPTS=-XX:+UseCompressedOops %JAVA_OPTS%"
          )
        )
      )
      
      if not "%PRESERVE_JAVA_OPTS%" == "true" (
        rem Add tiered compilation, if supported (64 bit VM), and not overriden
        echo "%JAVA_OPTS%" | findstr /I "\-XX:\-TieredCompilation \-client" > nul
        if errorlevel == 1 (
          "%JAVA%" -XX:+TieredCompilation -version > nul 2>&1
          if not errorlevel == 1 (
            set "JAVA_OPTS=-XX:+TieredCompilation %JAVA_OPTS%"
          )
        )
      )
      

              jgreene@redhat.com Jason Greene
              rsvoboda@redhat.com Rostislav Svoboda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: