IBM Support

Build fails with "Unrecognized option: --add-opens"

Troubleshooting


Problem

Builds running on agents using Java 8 fails with the following error:

================================================================================

 Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED

 Error: Could not create the Java Virtual Machine.

 Error: A fatal exception has occurred. Program will exit.

 

 ================================================================================

 Post Processing Script Execution Console Output:

Symptom

The issue occurs only with agents using Java 8.

Cause

The --add-opens option is being used, however Java 1.8 does not support it:
JAVA_OPTS=-Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -Dconsole.encoding=UTF-8 --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.jaxp=ALL-UNNAMED --add-opens=java.xml/javax.xml.parsers=ALL-UNNAMED

Diagnosing The Problem

Check the <Agent>\conf\plugin-javaopts.conf to confirm if --add-opens option is being used.

Resolving The Problem

If the --add-opens option is being used, remove it. The --add-opens parameter was made available in Java 9.

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS8NMD","label":"IBM UrbanCode Build"},"ARM Category":[{"code":"a8m50000000ChuKAAS","label":"UrbanCode Build"}],"ARM Case Number":"TS007392446","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Product Synonym

UCB

Document Information

Modified date:
11 November 2022

UID

ibm16837351