2023年5月29日 星期一

[研究]Fortify SCA 23.1.0 出現 'ReportGenerator.bat' 不是內部或外部命令、可執行的程式或批次檔。

[研究]Fortify SCA 出現 'ReportGenerator.bat' 不是內部或外部命令、可執行的程式或批次檔。

[研究]Micro Focus SCA 22.2.2 升級 OpenText Fortify SCA 23.1.0 後 ReportGenerator.bat 沒了

2023-05-29

把 22.2.2版

C:\Program Files\Fortify\Fortify_SCA_and_Apps_22.2.2\bin\ReportGenerator.bat 拷貝到

23.1.10版

C:\Program Files\Fortify\Fortify_SCA_23.1.0\bin 目錄,執行失敗。

檢查 ReportGenerator.bat

@echo off

rem /************************************************************************
rem * (C) Copyright 2004-2023 Micro Focus or one of its affiliates.
rem * The only warranties for products and services of Micro Focus and its
rem * affiliates and licensors ("Micro Focus") are set forth in the express
rem * warranty statements accompanying such products and services. Nothing
rem * herein should be construed as constituting an additional warranty.
rem * Micro Focus shall not be liable for technical or editorial errors or
rem * omissions contained herein. The information contained herein is subject
rem * to change without notice.
rem * Confidential computer software. Except as specifically indicated
rem * otherwise, a valid license from Micro Focus is required for possession,
rem * use or copying. Consistent with FAR 12.211 and 12.212, Commercial
rem * Computer Software, Computer Software Documentation, and Technical Data
rem * for Commercial Items are licensed to the U.S. Government under
rem * vendor's standard commercial license.
rem ************************************************************************/

set FORTIFY_HOME=%~dp0..

set JAVA_CMD=%FORTIFY_HOME%\jre\bin\java.exe

if not exist "%JAVA_CMD%" set JAVA_CMD=java.exe

:: Parse out the Java args that start with -X or -D
set USER_VM_OPTS=
set USER_OPTS=
shift
:moreargs
if x%0x == xx goto donewithargs
set arg=%0
set argnq=%arg:"=%
if %argnq:~0,2% == -X goto uservmargs
if %argnq:~0,2% == -D goto uservmargs
set USER_OPTS=%USER_OPTS% %arg%
goto skipvmargs
:uservmargs
set USER_VM_OPTS=%USER_VM_OPTS% %arg%
:skipvmargs
shift
goto moreargs
:donewithargs

if "%USER_VM_OPTS%" == "" set USER_VM_OPTS=-Xmx300m

rem echo FORTIFY_HOME: %FORTIFY_HOME%
rem echo USER_VM_OPTS: %USER_VM_OPTS%
rem echo USER_OPTS:    %USER_OPTS%

"%JAVA_CMD%" %USER_VM_OPTS% -jar "%FORTIFY_HOME%\Core\lib\exe\report-generator-exe.jar"  %USER_OPTS%


把 C:\Program Files\Fortify\Fortify_SCA_and_Apps_22.2.2\Core\lib\exe\report-generator-exe.jar

拷貝到

C:\Program Files\Fortify\Fortify_SCA_and_Apps_22.2.2\Core\lib\exe\report-generator-exe.jar

手動執行 ReportGenerator.bat 內容,出錯

C:\Program Files\Fortify\Fortify_SCA_23.1.0\bin>"%JAVA_CMD%" %USER_VM_OPTS% -jar "%FORTIFY_HOME%\Core\lib\exe\report-generator-exe.jar"  %USER_OPTS%
錯誤: 找不到或無法載入主要類別 %USER_VM_OPTS%
原因: java.lang.ClassNotFoundException: %USER_VM_OPTS%

C:\Program Files\Fortify\Fortify_SCA_23.1.0\bin>


********************************************************************************

解決:

把從 22.2.2 拷貝過來的砍掉,

把 Fortify_23.1.0.zip 解壓縮,

把 Fortify_Tools_23.1.0_Windows.zip 解壓縮,

執行 Fortify_Apps_and_Tools_23.1.0_windows_x64.exe 進行安裝,

就會有 ReportGenerator.bat 可用。

如果還不行,把 Windows Reboot,敝人實際測試就 OK 了。


(完)

沒有留言:

張貼留言