ant command fails for JRE 8

Document ID : KB000038673
Last Modified Date : 29/10/2018
Show Technical Document Details
Issue:

"ant upgrade-jre" command fails when trying to upgrade Catalog JRE to JRE 8  with the following error messages  from command prompt :

[input] Location of new Oracle JRE: 

D:\Program Files\Java\jre1.8.0_45\bin 

[input] What is the version of the new Oracle JRE (e.g. 1.7.0_40): 

1.8.0_45 

BUILD FAILED 

D:\Program Files\CA\Service Catalog\build.xml:1131: Catalog requires a server Java HotSpot(TM) Server VM 

Environment:
CA Service Catalog 14.1
Cause:
Path must be supplied correctly, and the Build.xml doesn’t include the latest JRE 8 and JRE9 yet in catalog 14.1
Resolution:
There are two problems here. Firstly, when prompted for the JRE location you should not specify the bin subfolder - in this case that would be 
D:\Program Files\Java\jre1.8.0_45


1) stop catalog service
2) make a backup copy of the current build.xml first ( it is located at service catalog installation home folder )
3) then modify build.xml :
change :
 <condition property="new.jre.is.supported">
<matches pattern="^(1.7.0_)([1][2-9]|[2-9][0-9])$" string="${new.jre.version}" />
</condition>
 
to :
<condition property="new.jre.is.supported">
<matches pattern="^(1.8.0_)([0-9][0-9])$" string="${new.jre.version}" />
</condition>
 
4) and then run that "ant upgrade-jre" command from catalog's command prompt to have catalog use the Java 8 that you just installed on the catalog machine .
5) restart catalog service