IBM i: Java error in host names with hyphens

[] [] [] [] [] [] [] [] [] [] [] [] [] []

Symptom
You execute an upgrade or an installation for a Java stack. Various SAP commands (for example, STARTSAP, STOPSAP) require the host name of your IBM i as a parameter.
Other terms
AS400, AS/400, OS400, OS/400, iSeries, SAP Enhancement Package installer, SAPehpi, SAPinst, upgrade
Reason and Prerequisites
This problem usually occurs during upgrades or installations if there is [...]